/**
 * Side Panel User Dropdown Component Styles
 * Issue #64: Header Dropdown with Lifecycle Management
 *
 * Provides styling for a small user dropdown button that fits in the side panel
 * Theme: Teal/cyan #64FFDA, Dark #0A0B1A
 */

/* Side Panel Dropdown Container */
.header-dropdown-container {
    position: relative;
    display: inline-block;
}

/* Side Panel Dropdown Trigger - Small Button */
.header-dropdown .dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    background: rgba(100, 255, 218, 0.1);
    border: 1px solid rgba(100, 255, 218, 0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px;
    font-size: 10px;
    color: #64FFDA;
}

.header-dropdown .dropdown-trigger:hover {
    background: rgba(100, 255, 218, 0.2);
    border-color: #64FFDA;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(100, 255, 218, 0.2);
}

.header-dropdown .dropdown-trigger:active {
    transform: translateY(0);
}

/* User Icon */
.header-dropdown .user-icon {
    font-size: 12px;
    color: #64FFDA;
}

/* Dropdown Arrow */
.header-dropdown .dropdown-arrow {
    font-size: 8px;
    margin-left: 2px;
    transition: transform 0.2s ease;
}

.header-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.header-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: #0A0B1A;
    border: 1px solid rgba(100, 255, 218, 0.3);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(100, 255, 218, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.header-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Account Section */
.header-dropdown .account-section {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
    margin-bottom: 4px;
}

.header-dropdown .user-email {
    font-size: 11px;
    color: #8892B0;
    margin-bottom: 4px;
    font-weight: 400;
}

.header-dropdown .subscription-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-dropdown .status-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-dropdown .status-badge.status-premium {
    background: rgba(100, 255, 218, 0.2);
    color: #64FFDA;
    border: 1px solid rgba(100, 255, 218, 0.3);
}

.header-dropdown .status-badge.status-grace-period {
    background: rgba(255, 193, 7, 0.2);
    color: #FFD43B;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.header-dropdown .status-badge.status-free {
    background: rgba(139, 146, 176, 0.2);
    color: #8892B0;
    border: 1px solid rgba(139, 146, 176, 0.3);
}

/* Dropdown Items */
.header-dropdown .dropdown-item {
    display: block;
    width: 100%;
    padding: 6px 12px;
    background: none;
    border: none;
    color: #FFFFFF;
    text-align: left;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    transition: all 0.2s ease;
    text-decoration: none;
}

.header-dropdown .dropdown-item:hover {
    background: rgba(100, 255, 218, 0.1);
    color: #64FFDA;
}

.header-dropdown .dropdown-item:active {
    background: rgba(100, 255, 218, 0.2);
}

/* Manage Subscription Button */
.header-dropdown .manage-subscription {
    color: #64FFDA;
    font-weight: 500;
}

.header-dropdown .manage-subscription:hover {
    background: rgba(100, 255, 218, 0.15);
}

/* Sign Out Button */
.header-dropdown .sign-out {
    color: #FF6B6B;
    border-top: 1px solid rgba(100, 255, 218, 0.1);
    margin-top: 4px;
    padding-top: 8px;
}

.header-dropdown .sign-out:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #FF8A8A;
}

/* Grace Period Info */
.header-dropdown .grace-period-info {
    font-size: 10px;
    color: #FFD43B;
    margin-top: 2px;
    opacity: 0.9;
}

/* Loading State */
.header-dropdown .loading {
    opacity: 0.6;
    pointer-events: none;
}

.header-dropdown .loading .dropdown-trigger::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border: 1px solid #64FFDA;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error State */
.header-dropdown.error .dropdown-trigger {
    border-color: #FF6B6B;
    background: rgba(255, 107, 107, 0.1);
}

.header-dropdown.error .user-icon {
    color: #FF6B6B;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header-dropdown .dropdown-menu {
        right: -10px;
        min-width: 180px;
    }

    .header-dropdown .dropdown-item {
        padding: 8px 12px;
        font-size: 13px;
    }

    .header-dropdown .dropdown-trigger {
        width: 30px;
        height: 22px;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .header-dropdown .dropdown-trigger {
        border-width: 2px;
    }

    .header-dropdown .dropdown-menu {
        border-width: 2px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .header-dropdown .dropdown-trigger,
    .header-dropdown .dropdown-menu,
    .header-dropdown .dropdown-arrow {
        transition: none;
    }

    .header-dropdown .loading .dropdown-trigger::after {
        animation: none;
    }
}

/* Grace Period Countdown Section */
.header-dropdown .grace-period-countdown-section {
    padding: 8px 12px;
    background: rgba(255, 193, 7, 0.03);
    border-top: 1px solid rgba(255, 193, 7, 0.15);
    border-bottom: 1px solid rgba(255, 193, 7, 0.15);
    margin: 4px 0;
}

.header-dropdown .grace-period-countdown-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 10px;
    color: #FFD43B;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-dropdown .countdown-icon {
    font-size: 11px;
}

.header-dropdown .grace-period-countdown-timer {
    font-size: 14px;
    font-weight: 600;
    color: #FFD43B;
    text-align: center;
    padding: 4px;
    background: rgba(255, 193, 7, 0.08);
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

/* Upgrade Section */
.header-dropdown .upgrade-section {
    padding: 6px 12px 8px 12px;
}

.header-dropdown .btn-upgrade-now {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    background: rgba(100, 255, 218, 0.15);
    color: #64FFDA;
    border: 1px solid rgba(100, 255, 218, 0.3);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-dropdown .btn-upgrade-now:hover {
    background: rgba(100, 255, 218, 0.25);
    border-color: #64FFDA;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(100, 255, 218, 0.2);
}

.header-dropdown .btn-upgrade-now:active {
    transform: translateY(0);
    background: rgba(100, 255, 218, 0.2);
}

.header-dropdown .upgrade-icon {
    font-size: 12px;
}

.header-dropdown .upgrade-text {
    font-size: 12px;
}

/* Focus States for Accessibility */
.header-dropdown .dropdown-trigger:focus {
    outline: 2px solid #64FFDA;
    outline-offset: 2px;
}

.header-dropdown .dropdown-item:focus {
    background: rgba(100, 255, 218, 0.2);
    color: #64FFDA;
    outline: 1px solid #64FFDA;
    outline-offset: -1px;
}

.header-dropdown .btn-upgrade-now:focus {
    outline: 2px solid #64FFDA;
    outline-offset: 2px;
}