/* Styles communs partagés entre toutes les pages */

:root {
    --auth-primary: #4f9dff;
    --auth-primary-glow: #2563ff;
    --auth-bg: #000000;
    --auth-card-bg: rgba(15, 23, 42, 0.95);
    --auth-text: #ffffff;
    --auth-text-muted: #9ca3af;
    --auth-border: rgba(79, 157, 255, 0.3);
    --auth-error: #ef4444;
    --auth-success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE et Edge */
}

*::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

html {
    background: #2d3748;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: 
        radial-gradient(ellipse at center top, rgba(37, 99, 235, 0.4) 0%, rgba(30, 58, 95, 0.3) 25%, rgba(45, 55, 72, 0.6) 50%, rgba(45, 55, 72, 0.9) 75%, #2d3748 100%),
        linear-gradient(180deg, #2563eb 0%, #1e3a5f 50%, #2d3748 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    color: var(--auth-text);
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Header Styles */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(30, 40, 60, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    transform: translateZ(0);
    width: 100%;
    overflow: visible;
}

.navbar {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 15px 30px 15px 0;
    width: 100%;
    box-sizing: border-box;
    gap: 40px;
}

.nav-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    justify-content: flex-start;
    margin-left: 0;
    padding-left: 15px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    justify-content: flex-end;
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 12px;
    flex-shrink: 0;
    overflow: visible;
    border: none;
    background: transparent;
    outline: none;
    box-shadow: none;
    z-index: 10001;
}

.user-profile:hover {
    background: rgba(15, 23, 42, 0.5);
}

.user-profile::after,
.user-profile::before {
    display: none;
    content: none;
}

.user-profile:hover .user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(79, 157, 255, 0.4);
    box-shadow: 0 0 2px rgba(79, 157, 255, 0.1);
    object-fit: cover;
    flex-shrink: 0;
    outline: none;
}

.user-username {
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    white-space: nowrap;
}

.user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    padding: 8px 0;
    min-width: 180px;
    box-shadow: 
        0 0 30px rgba(79, 157, 255, 0.2),
        0 0 60px rgba(79, 157, 255, 0.1);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    z-index: 10000;
    pointer-events: none;
    transition: opacity 0.05s ease, transform 0.05s ease;
}

.user-menu-item {
    display: block;
    padding: 10px 20px;
    color: var(--auth-text);
    text-decoration: none;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.user-menu-item:hover {
    background: rgba(79, 157, 255, 0.1);
    color: var(--auth-primary);
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    transform: translateZ(0);
    backface-visibility: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
    overflow: hidden;
    max-width: 100%;
}

.logo-link:hover {
    opacity: 0.85;
}

.logo-link:active {
    opacity: 0.75;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    max-width: 100%;
    overflow: hidden;
}

.logo-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.9);
    border: 2px solid var(--auth-primary);
    box-shadow: 0 0 12px rgba(79, 157, 255, 0.3);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transform: translateZ(0);
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    transform: translateZ(0);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--auth-text);
    letter-spacing: -0.03em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.logo-K-text {
    color: #4a9eff;
}

.nav-center {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 5px;
}

.nav-link:hover {
    color: #4a9eff;
}

.nav-link.active {
    color: #4a9eff;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #4a9eff;
}

.discord-icon-btn {
    width: 50px;
    height: 50px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 12px;
    border: 2px solid var(--auth-primary);
    box-shadow: 0 0 10px rgba(79, 157, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform, box-shadow;
    contain: layout style paint;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
    overflow: hidden;
}

.discord-icon-btn:hover {
    background: rgba(15, 23, 42, 1);
    border-color: var(--auth-primary);
    box-shadow: 0 0 16px rgba(79, 157, 255, 0.5);
    transform: translateY(-1px) translateZ(0);
}

.discord-icon-btn:active {
    transform: translateY(0) translateZ(0);
    box-shadow: 0 0 10px rgba(79, 157, 255, 0.3);
}

.discord-icon-btn svg {
    width: 28px;
    height: 28px;
    pointer-events: none;
    transform: translateZ(0);
}

.btn-login,
.btn-register {
    padding: 12px 24px;
    background: rgba(15, 23, 42, 0.9);
    border: 2px solid var(--auth-primary);
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(79, 157, 255, 0.25);
    color: var(--auth-text);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transform: translateZ(0);
    backface-visibility: hidden;
    user-select: none;
    will-change: transform, box-shadow;
    contain: layout style paint;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    flex-shrink: 0;
    overflow: hidden;
}

.btn-login:hover,
.btn-register:hover {
    background: rgba(15, 23, 42, 1);
    border-color: var(--auth-primary);
    box-shadow: 0 0 16px rgba(79, 157, 255, 0.5);
    transform: translateY(-1px) translateZ(0);
}

.btn-login:active,
.btn-register:active {
    transform: translateY(0) translateZ(0);
    box-shadow: 0 0 10px rgba(79, 157, 255, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 140px 30px 219px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at center top, rgba(37, 99, 235, 0.4) 0%, rgba(30, 58, 95, 0.3) 25%, rgba(45, 55, 72, 0.6) 50%, rgba(45, 55, 72, 0.9) 75%, #2d3748 100%),
        linear-gradient(180deg, #2563eb 0%, #1e3a5f 50%, #2d3748 100%);
    transform: translateZ(0);
    z-index: 1;
}

.main-content::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: radial-gradient(ellipse at center top, rgba(37, 99, 235, 0.3), rgba(45, 55, 72, 0));
    filter: blur(40px);
    opacity: 0.6;
    animation: main-glow 20s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

@keyframes main-glow {
    0% {
        transform: translate3d(0, 0, 0) scale(1) translateZ(0);
    }
    100% {
        transform: translate3d(0, 10%, 0) scale(1.08) translateZ(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .main-content::before {
        animation: none;
    }
}

.main-content > * {
    position: relative;
    z-index: 1;
}

/* Main Footer */
.main-footer {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    text-align: center;
    z-index: 1;
    width: auto;
    max-width: 1400px;
    padding: 12px 24px;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Discord Login Modal */
.discord-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateZ(0);
}

.discord-modal.active {
    opacity: 1;
    visibility: visible;
}

.discord-modal-content {
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-border);
    border-radius: 24px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    position: relative;
    box-shadow: 
        0 0 50px rgba(79, 157, 255, 0.3),
        0 0 100px rgba(79, 157, 255, 0.15),
        inset 0 0 40px rgba(79, 157, 255, 0.05);
    backdrop-filter: blur(10px);
    transform: translateY(20px) scale(0.95);
}

.discord-modal.active .discord-modal-content {
    transform: translateY(0) scale(1);
}

.discord-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--auth-text-muted);
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transform: translateZ(0);
    touch-action: manipulation;
}

.discord-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--auth-text);
}

.discord-modal-close:active {
    transform: scale(0.95) translateZ(0);
}

.discord-modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.discord-modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: rgba(88, 101, 242, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5865f2;
    box-shadow: 0 0 25px rgba(88, 101, 242, 0.3);
}

.discord-modal-icon svg {
    width: 50px;
    height: 50px;
}

.discord-modal-title {
    font-size: 28px;
    font-weight: 900;
    color: var(--auth-text);
    margin-bottom: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: -0.03em;
}

.discord-modal-description {
    font-size: 15px;
    color: var(--auth-text-muted);
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.discord-modal-body {
    margin-top: 30px;
}

.discord-oauth-btn {
    width: 100%;
    padding: 16px 24px;
    background: #5865f2;
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transform: translateZ(0);
    backface-visibility: hidden;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.4);
    touch-action: manipulation;
    user-select: none;
}

.discord-oauth-btn:hover {
    background: #4752c4;
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
}

.discord-oauth-btn:active {
    transform: translateY(0) translateZ(0);
    box-shadow: 0 2px 10px rgba(88, 101, 242, 0.4);
}

.discord-oauth-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Responsive Design Commun */
@media (max-width: 768px) {
    .header {
        overflow-x: hidden;
    }
    
    .navbar {
        flex-wrap: nowrap;
        padding: 15px 20px;
        gap: 10px;
    }
    
    .nav-left {
        flex-shrink: 1;
        min-width: 0;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
    }
    
    .nav-center {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 15px;
        gap: 20px;
        flex-wrap: wrap;
    }
    
    .nav-right {
        gap: 8px;
        flex-shrink: 0;
    }
    
    .btn-login,
    .btn-register {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .discord-icon-btn {
        width: 40px;
        height: 40px;
    }
    
    .discord-icon-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .user-profile {
        padding: 4px 8px;
    }
    
    .user-avatar-small {
        width: 28px;
        height: 28px;
    }
    
    .user-username {
        font-size: 12px;
    }
    
    .main-content {
        padding: 60px 20px;
    }
    
    .discord-modal-content {
        padding: 30px 20px;
        max-width: 90%;
    }
    
    .discord-modal-title {
        font-size: 24px;
    }
    
    .discord-modal-description {
        font-size: 14px;
    }
    
    .discord-oauth-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
}