/**
 * YoseMovie Header Component Styles
 * デスクトップ・モバイル対応の再利用可能なヘッダーコンポーネント
 */

/* Base Header Styles */
.header {
    background: #ffcc02;
    border-bottom: 1px solid #e6b800;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 204, 2, 0.95);
    transition: all 0.3s ease, transform 0.3s ease;
    transform: translateY(0);
}

.header.scrolled {
    background: rgba(255, 204, 2, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header.header-hidden {
    transform: translateY(-100%);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo-svg {
    height: 50px;
    width: auto;
}

/* Navigation Links */
.nav-links {
    display: flex;
    gap: 32px;
    justify-content: center;
    flex: 1;
}

.nav-link {
    color: #1d1d1f !important;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 14px;
    position: relative;
}

.nav-link:hover {
    color: #2d3436 !important;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: #1d1d1f;
    border-radius: 1px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: #1d1d1f;
    border-radius: 1px;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-link:hover::after {
    transform: scaleX(1);
}

/* Header Buttons */
.header-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-login {
    background: #1d1d1f;
    color: #ffcc02;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
}

.btn-login:hover {
    background: #2d2d2f;
    transform: translateY(-1px);
}

.mobile-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: block;
    width: 40px;
    height: 40px;
    transition: background-color 0.3s ease;
    border-radius: 4px;
    position: relative;
}

.mobile-menu-btn:hover {
    background: rgba(29, 29, 31, 0.1);
}

.mobile-menu-btn span {
    display: block;
    height: 2px;
    width: 24px;
    background: #1d1d1f;
    border-radius: 1px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.3s ease;
}

.mobile-menu-btn span:nth-child(1) {
    top: 11px;
}

.mobile-menu-btn span:nth-child(2) {
    top: 50%;
    transform: translate(-50%, -50%);
}

.mobile-menu-btn span:nth-child(3) {
    bottom: 11px;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .header {
        height: 60px;
    }
    
    .header-container {
        height: 60px;
        padding: 0 20px;
    }
    
    /* Hide navigation on mobile */
    .nav-links {
        display: none !important;
    }
    
    /* Mobile login button */
    .btn-login {
        border-radius: 20px !important;
        border: none !important;
        background: #1d1d1f !important;
        color: #ffcc02 !important;
        padding: 6px 12px !important;
        font-weight: 600 !important;
        font-size: 11px !important;
    }
    
    /* Mobile header buttons */
    .header-buttons {
        gap: 12px;
    }
    
    /* Show mobile menu button */
    .mobile-menu-btn {
        padding: 4px;
        display: block;
        width: 32px;
        height: 32px;
    }
    
    .mobile-menu-btn span:nth-child(1) {
        top: 9px;
    }
    
    .mobile-menu-btn span:nth-child(3) {
        bottom: 9px;
    }
    
    /* Smaller logo on mobile */
    .logo-svg {
        height: 32px;
    }
}

/* Desktop - keep mobile menu button visible */
@media (min-width: 769px) {
    .mobile-menu-btn {
        display: flex;
    }
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, var(--menu-overlay-opacity, 0.8));
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--menu-fade-speed, 300ms) var(--menu-easing, ease),
                visibility var(--menu-fade-speed, 300ms) var(--menu-easing, ease);
    display: none;
}

.mobile-menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    background: white;
    transform: translateX(100%);
    transition: transform var(--menu-slide-speed, 300ms) var(--menu-easing, ease);
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu-overlay.open .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #ffcc02;
}

.mobile-logo {
    height: 32px;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 24px;
    font-weight: bold;
    color: #1d1d1f;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
    min-height: 0;
}

.mobile-nav-link {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: #1d1d1f;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.mobile-nav-link:hover {
    background: #f8f9fa;
    color: #ffcc02;
}

.mobile-nav-link:last-child {
    border-bottom: none;
}

.mobile-nav-link.company-link {
    padding: 4px 20px;
    font-size: 14px;
    color: #636e72;
    font-weight: 400;
    border-bottom: none;
}

.mobile-nav-divider {
    border-top: 1px solid #e9ecef;
    margin: 8px 0;
}

.mobile-menu-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
}

.mobile-login-btn {
    display: block;
    text-align: center;
    padding: 14px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    background: #ffcc02;
    color: #2d3436;
    border: 2px solid #ffcc02;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.mobile-login-btn:hover {
    background: #e6b800;
    border-color: #e6b800;
}

/* ログアウトボタン (マイページボタンと同じサイズ・全幅) */
.mobile-logout-btn {
    background: white;
    color: #636e72;
    border: 2px solid #e9ecef;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 24px;
    margin-bottom: 40px;
    display: block;
    width: 100%;
    text-align: center;
    transition: all 0.2s ease;
}
.mobile-logout-btn:hover {
    color: #e74c3c;
    border-color: #e74c3c;
    background: #fff5f5;
}

/* ユーザー情報行 (アバター + 名前) */
.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #2d3436;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mobile-user-info::before {
    content: '';
    display: inline-block;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: #e9ecef url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23636e72'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E") center/16px no-repeat;
}

/* Page body adjustment for fixed header */
body.has-header {
    padding-top: 80px;
}

@media (max-width: 768px) {
    body.has-header {
        padding-top: 60px;
    }
}

/* Header variants */
.header.transparent {
    background: transparent;
    border-bottom: none;
}

.header.dark {
    background: #1d1d1f;
    border-bottom-color: #2d2d2f;
}

.header.dark .nav-link {
    color: #ffffff !important;
}

.header.dark .nav-link:hover {
    color: #ffcc02 !important;
}

.header.dark .mobile-menu-btn {
    color: #ffffff;
}

.header.dark .btn-login {
    background: #ffcc02;
    color: #1d1d1f;
}

.header.dark .btn-login:hover {
    background: #e6b800;
}

/* Animation classes */
.header.slide-down {
    animation: slideDown 0.3s ease-out;
}

.header.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-100%);
    }
}

/* Loading state */
.header.loading {
    opacity: 0.7;
    pointer-events: none;
}

.header.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffcc02, #e6b800, #ffcc02);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}