/* ======================================= */
/* BASE & TYPOGRAPHY (Modern Styles)       */
/* ======================================= */
body { 
    font-family: 'Roboto', sans-serif; 
    background: #f0f2f5; 
    color: #1c1e21; 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    padding: 20px; 
    padding-top: 80px;
}
h1 { margin-bottom: 30px; font-weight: 700; color: #007bff; font-size: 2.5em; }

/* HEADER & UTILITIES */
header { 
    position: fixed; top: 0; left: 0; width: 100%; height: 65px; background: #ffffff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); display: flex; justify-content: space-between; align-items: center; padding: 0 20px; z-index: 50; 
}
.header-left { display: flex; align-items: center; }
.profile-icon { background: #007bff; color: white; border-radius: 50%; width: 38px; height: 38px; display: flex; justify-content: center; align-items: center; cursor: pointer; margin-left: 10px; }
#headerWallet { font-weight: 500; font-size: 1.1em; color: #007bff; }
.coin-suffix { font-size: 0.6em; font-weight: 400; color: #99cfff; margin-left: 3px; }

.profile-details { 
    position: absolute; top: 55px; left: 0; background: white; padding: 10px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); display: none; min-width: 180px; z-index: 51; 
}
#userDisplay { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.logout-btn { background: #dc3545; color: white; font-size: 0.9em; padding: 6px 10px; border-radius: 5px; font-weight: 500; border: none; cursor: pointer; }
.profile-img { background: #007bff; color: white; border-radius: 50%; width: 35px; height: 35px; display: flex; justify-content: center; align-items: center; font-size: 1em; }
.chat-btn-global { background: #28a745; color: white; padding: 8px 15px; border-radius: 50px; font-weight: 500; cursor: pointer; font-size: 0.9em; }
.auth-controls button { background: #007bff; color: white; border: none; font-weight: 500; cursor: pointer; padding: 8px 12px; border-radius: 8px; }
.auth-controls button:hover { opacity: 0.9; }

/* CARDS & LAYOUT */
.card-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin-bottom: 30px; width: 100%; max-width: 1200px; }

/* ADDING DISCOUNT CARD STYLING */
.discount-card { background: #6f42c1; color: white; }

.wallet-card, .fast-card, .withdrawal-card, .limit-card, .discount-card { 
    padding: 25px; 
    border-radius: 12px; 
    text-align: center; 
    width: 280px; 
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}
.wallet-card { background: #3b5998; color: white; }
.fast-card { background: #007bff; color: white; }
.withdrawal-card { background: #ff7878; color: white; }
.limit-card { background: #ff9800; color: white; }

.wallet-balance { font-size: 2.5em; font-weight: 700; margin: 10px 0; }
.btn-order, .btn-withdrawal, .btn-limit, .btn-discount { 
    padding: 10px 20px; 
    border-radius: 25px; 
    font-weight: 600; 
    border: none; 
    color: white; 
    margin-top: 15px; 
    cursor: pointer; 
}
.btn-order { background: #28a745; }
.btn-withdrawal { background: #9e1b21; }
.btn-limit { background: #007bff; }
.btn-discount { background: #dc3545; }

/* --- STATS CARD CONTAINER --- */
.stats-container {
    width: 100%;
    max-width: 1000px;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px;
}
.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}
.stat-icon {
    font-size: 2em;
    color: #007bff;
    margin-bottom: 10px;
}
.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #1c1e21;
}
.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

/* TRACKING & MODALS */
.tracking-sections { 
    width: 100%; 
    max-width: 1200px; 
    margin-top: 30px; 
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.tracking-box { 
    background: white; 
    padding: 0; 
    border-radius: 12px; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); 
}

.tracking-header {
    padding: 20px;
    font-size: 1.5em; 
    color: #3b5998; 
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f0f2f5;
    transition: background 0.2s;
}
.tracking-header:hover {
    background: #f9f9f9;
}

.tracking-content {
    padding: 0 20px 20px 20px;
    display: none; 
}
.tracking-content.active {
    display: block;
}

.tracking-box h2 { 
    margin: 0; 
    font-size: 1.2em; 
}

.tracking-item { border: 1px solid #e0e0e0; padding: 12px; margin-bottom: 8px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; font-size: 0.9em; }

.status-badge { padding: 4px 8px; border-radius: 15px; font-size: 0.75em; font-weight: 600; color: white; }
.status-pending { background: #ffc107; color: #333; }
.status-approved { background: #28a745; }
.status-rejected { background: #dc3545; }

.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); z-index: 1000; justify-content: center; align-items: center; }
.modal-content { background: white; padding: 25px; border-radius: 12px; width: 90%; max-width: 400px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); position: relative; }
.close-btn { position: absolute; top: 10px; right: 10px; font-size: 24px; font-weight: bold; cursor: pointer; color: #aaa; }
.form-group input, .form-group select, .form-group textarea { border: 1px solid #ced4da; border-radius: 6px; padding: 10px; width: 100%; box-sizing: border-box; margin-bottom: 10px; }
.btn-submit-order, .btn-submit-withdrawal { width: 100%; padding: 10px; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; background: #007bff; color: white; }

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    body { padding: 10px; padding-top: 65px; }
    header { padding: 0 10px; }
    .card-container { flex-direction: column; align-items: center; gap: 15px; }
    .wallet-card, .fast-card, .withdrawal-card, .limit-card, .discount-card { width: 100%; max-width: 400px; padding: 20px; }
    .wallet-balance { font-size: 2em; }
    .tracking-sections, .stats-container { grid-template-columns: 1fr; }
    .tracking-item { flex-direction: column; align-items: flex-start; }
    .tracking-item > div:last-child { width: 100%; text-align: left !important; margin-top: 5px; }
}

/* --- Dynamic Discount Card Styling --- */
#discountCardDisplay {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6f42c1, #dc3545);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    display: none; 
}
.card-header { font-size: 1.3em; font-weight: 700; border-bottom: 1px solid rgba(255, 255, 255, 0.3); padding-bottom: 5px; margin-bottom: 10px; }
.card-detail { font-size: 0.9em; margin: 5px 0; }
.card-validity { font-size: 0.8em; opacity: 0.8; margin-top: 10px; text-align: right; }

.copy-btn {
    background: none;
    border: none;
    color: #ffc107;
    margin-left: 5px;
    cursor: pointer;
    font-size: 0.8em;
    padding: 0;
    transition: color 0.2s;
}
.copy-btn:hover {
    color: #fff;
}

/* --- Live Ticker Styling (TOP FIX) --- */
#withdrawalTicker {
    position: absolute; /* Changed to absolute to be relative to the closest positioned ancestor (body or window) */
    top: 65px; /* Directly below the fixed header */
    left: 50%;
    transform: translateX(-50%);
    z-index: 50; /* Above regular content, below header */
    pointer-events: none;
    width: 90%;
    max-width: 450px; /* Slightly wider for better visibility */
}
.ticker-message {
    background: rgba(40, 167, 69, 0.95); /* Greenish background */
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    transform: translateY(-20px);
    font-weight: 500;
    font-size: 0.95em;
    pointer-events: auto; /* Make visible to clicks if needed */
}
.ticker-message.show {
    opacity: 1;
    transform: translateY(0);
}
.ticker-message i {
    margin-right: 8px;
}
</style>
