/**
 * iColorFill - Header Stylesheet
 * Header 组件样式
 */

/* Header Styles */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 43, 54, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(211, 54, 130, 0.2);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.header-icon-img {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.header-title {
    font-family: "Lexend", sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #fff;
    text-transform: uppercase;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    font-family: "Lexend", sans-serif;
    font-size: 14px;
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-link:hover {
    color: #fff;
}

/* Header Button */
.header-btn {
    padding: 10px 24px;
    background: transparent;
    border: 1px solid #d33682;
    border-radius: 25px;
    color: #d33682;
    font-family: "Lexend", sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.header-btn:hover {
    background: #d33682;
    color: #002b36;
}

/* User Section */
.header-user-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logged-in-state {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Credits Display */
.credits-menu-wrapper {
    position: relative;
}

.credits-display {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(211, 54, 130, 0.1);
    border: 1px solid rgba(211, 54, 130, 0.3);
    border-radius: 20px;
    color: #d33682;
    font-family: "Lexend", sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.credits-display:hover {
    background: rgba(211, 54, 130, 0.2);
    border-color: #d33682;
}

/* Check-in Button */
.checkin-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(52, 168, 83, 0.1);
    border: 1px solid rgba(52, 168, 83, 0.3);
    color: #34a853;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.checkin-btn:hover:not(:disabled) {
    background: #34a853;
    color: #fff;
    border-color: #34a853;
}

.checkin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkin-btn.checked {
    background: rgba(52, 168, 83, 0.2);
    border-color: #34a853;
    color: #34a853;
}

/* Check-in Wrapper & Tooltip */
.checkin-wrapper {
    position: relative;
}

.checkin-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    padding: 12px 14px;
    background: rgba(0, 43, 54, 0.98);
    border: 1px solid rgba(211, 54, 130, 0.3);
    border-radius: 10px;
    color: #93a1a1;
    font-family: "Lexend", sans-serif;
    font-size: 0.8rem;
    line-height: 1.5;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.checkin-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 12px;
    width: 10px;
    height: 10px;
    background: rgba(0, 43, 54, 0.98);
    border-left: 1px solid rgba(211, 54, 130, 0.3);
    border-top: 1px solid rgba(211, 54, 130, 0.3);
    transform: rotate(45deg);
}

.checkin-wrapper:hover .checkin-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* User Menu */
.credits-menu-wrapper .user-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 220px;
    background: rgba(0, 43, 54, 0.98);
    border: 1px solid rgba(211, 54, 130, 0.2);
    border-radius: 12px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 16px;
}

.user-email {
    font-family: "Lexend", sans-serif;
    font-size: 13px;
    color: #93a1a1;
    word-break: break-all;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-family: "Lexend", sans-serif;
    font-size: 14px;
    color: #aaa;
    text-decoration: none;
    transition: all 0.2s ease;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
}

.dropdown-item:hover {
    background: rgba(211, 54, 130, 0.1);
    color: #fff;
}

.logout-btn {
    color: #dc3545;
}

.logout-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Check-in Toast */
.checkin-toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: linear-gradient(135deg, #34a853, #2d9348);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(52, 168, 83, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
}

.checkin-toast.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-family: "Lexend", sans-serif;
    font-size: 15px;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background: #d33682;
    transition: all 0.3s ease;
}

/* Hamburger animation when active */
.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Responsive */
@media screen and (max-width: 1024px) {
    .header-nav {
        gap: 20px;
    }
    .nav-link {
        font-size: 12px;
    }
}

@media screen and (max-width: 768px) {
    .header-container {
        padding: 12px 16px;
    }
    
    .header-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(0, 43, 54, 0.98);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        border-bottom: 1px solid rgba(211, 54, 130, 0.2);
    }
    
    .header-nav.active {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .header-icon-img {
        width: 36px;
        height: 36px;
    }
    
    .header-title {
        font-size: 1.2rem;
    }
    
    .header-user-section {
        width: 100%;
        justify-content: center;
        padding-top: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 10px;
    }
    
    .user-dropdown {
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
    }
    
    .user-dropdown.active {
        transform: translateX(-50%) translateY(0);
    }
}
