/* ===================================================================
   APP HEADER - UNIFIED STYLES FOR ALL APP PAGES
   Used by: app/index.html, app/account.html
   =================================================================== */

/* Credits Dropdown */
.credits-dropdown {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.credits-dropdown:hover {
    background: rgba(255,255,255,0.05);
}

.coin-icon {
    font-size: 18px;
}

.total-coins {
    font-weight: 600;
    font-size: 16px;
}

/* Credits Panel (Dropdown) */
.credits-panel {
    position: absolute;
    top: 45px;
    right: 100px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    min-width: 300px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 1000;
    color: #333;
    display: none;
}

.credits-panel.active {
    display: block !important;
}

/* Panel Header */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.tier-name {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.btn-add-credits {
    background: #333;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add-credits:hover {
    background: #111;
}

/* Total Section - Main Credit Display */
.total-section {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8e8e8;
}

.total-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.total-section .section-header span:first-child {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.total-section .total-value {
    font-size: 13px;
    font-weight: 700;
    color: #333;
}

/* Credits Section - Breakdown */
.credits-section {
    margin-bottom: 16px;
}

.credit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: 13px;
    color: #666;
}

.credit-row span:first-child {
    color: #666;
    font-weight: 400;
}

.credit-row span:last-child {
    color: #555;
    font-weight: 500;
    font-size: 13px;
}

.help-icon {
    font-size: 14px;
    color: #999;
    cursor: help;
    position: relative;
}

.help-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    top: -45px;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: pre-line;
    width: 200px;
    text-align: center;
    z-index: 1000;
    line-height: 1.4;
}

.help-icon:hover::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -5px;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

/* Mobile-friendly tooltip positioning */
@media (max-width: 480px) {
    .help-icon:hover::after {
        left: auto;
        right: -10px;
        transform: none;
        width: 180px;
        font-size: 11px;
    }
    
    .help-icon:hover::before {
        left: auto;
        right: 20px;
        transform: none;
    }
}

/* Daily Section */
.daily-section {
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
    margin-bottom: 16px;
}

.daily-refresh {
    font-size: 12px;
    color: #999;
    text-align: left;
}

/* View Usage Button */
.view-usage-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

.view-usage-btn:hover {
    background: #f5f5f5;
}

/* Storefront Quick Access Button */
.storefront-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    transition: background 0.2s, border-color 0.2s;
}

.storefront-nav-btn:hover {
    background: #f5f5f5;
    border-color: #d5d5d5;
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Mobile responsive fixes for credits panel */
@media (max-width: 768px) {
    .credits-panel {
        top: 38px !important; /* Align with dropdown menu position */
        right: 0;
        left: auto;
        min-width: 280px;
        max-width: calc(100vw - 20px);
    }
    
    .credits-trigger {
        padding: 6px 10px;
    }

    .storefront-nav-btn {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .credits-panel {
        position: absolute;
        top: 38px !important; /* Align with dropdown menu position */
        right: 0;
        left: auto;
        transform: none;
        min-width: 250px;
        max-width: calc(100% - 20px);
    }
}

.dropdown-toggle {
    font-size: 14px;
    opacity: 0.7;
}

.dropdown-menu {
    position: absolute;
    top: 38px;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: none;
    flex-direction: column;
    min-width: 150px;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.dropdown-menu.active {
    display: flex;
}

.dropdown-menu a {
    padding: 10px 14px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}
