:root {
    --bg-color: #08080a;
    --card-bg: rgba(15, 15, 18, 0.75);
    --card-border: rgba(197, 160, 89, 0.2);
    --gold: #c5a059;
    --gold-hover: #e0b666;
    --gold-light: #f5e2b3;
    --gold-dark: #8c6827;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --error: #e74c3c;
    --gold-gradient: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
    --gold-glow: rgba(197, 160, 89, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(197, 160, 89, 0.15) 0%, rgba(8, 8, 10, 0) 70%);
}

#particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.view {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.view.active {
    display: flex;
    opacity: 1;
}

/* Glassmorphism */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

/* Login View */
#login-view {
    align-items: center;
}

.login-card {
    width: 100%;
    max-width: 450px;
    text-align: center;
    margin-top: auto;
    margin-bottom: auto;
}

.logo-container {
    margin-bottom: 30px;
}

.logo-img {
    max-width: 250px;
    height: auto;
    margin-bottom: 20px;
}

.logo-container h1 {
    font-weight: 600;
    font-size: 32px;
    letter-spacing: 4px;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.tagline {
    font-size: 14px;
    color: var(--gold-light);
    opacity: 0.9;
}

.tagline span {
    font-weight: 600;
    color: var(--gold);
}

.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(10, 10, 12, 0.85);
    border: 1px solid rgba(197, 160, 89, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 16px;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: var(--gold);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px var(--gold-glow);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--gold-gradient);
    color: #0c0c0e;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.2);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 30%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    transition: transform 0.5s ease;
    pointer-events: none;
}

.btn-primary:hover::after {
    transform: rotate(30deg) translate(20%, 20%);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(197, 160, 89, 0.4);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.error-msg {
    color: var(--error);
    font-size: 14px;
    min-height: 20px;
    margin-bottom: 15px;
}

/* Dashboard View */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(0,0,0,0.4);
    border-bottom: 1px solid var(--card-border);
}

.header-logo {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 2px;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    border-color: var(--text-main);
    background: rgba(255,255,255,0.05);
}

.dashboard-content {
    flex: 1;
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-title {
    margin-bottom: 40px;
}

.section-title h2 {
    font-weight: 600;
    font-size: 28px;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.section-title p {
    color: var(--text-muted);
}

.licenses-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.license-card {
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    padding: 20px;
    flex: 1 1 350px;
    max-width: 480px;
    opacity: 0; /* overridden by animation when active */
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.license-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px var(--gold-glow);
    border-color: rgba(197, 160, 89, 0.4);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.license-card.animate-in {
    animation: slideUpFade 0.6s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.card-header {
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.card-header h3 {
    font-weight: 400;
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 10px;
    min-height: 52px; /* Force 2 lines height for perfect horizontal alignment */
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.badge.active { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.badge.lifetime { background: rgba(197, 160, 89, 0.2); color: var(--gold); }

.key-box {
    background: rgba(0,0,0,0.5);
    padding: 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    color: var(--gold);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
}
.copy-btn:hover {
    color: var(--gold-light);
    transform: scale(1.1);
}
.copy-btn.copied {
    color: #2ecc71 !important;
    animation: popCheck 0.3s ease;
}

@keyframes popCheck {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.download-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 10px;
    border-radius: 6px;
    transition: all 0.3s;
}

.download-btn:hover {
    background: var(--gold);
    color: #000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(197, 160, 89, 0.3);
    border-radius: 50%;
    border-top-color: var(--gold);
    animation: spin 1s ease-in-out infinite;
    margin: 40px auto;
}

.hidden { display: none !important; }

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

/* --- ADMIN PANEL --- */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    text-align: center;
    padding: 20px;
}
.stat-value {
    font-size: 36px;
    color: var(--gold);
    font-weight: 600;
    margin-top: 10px;
}
.admin-tools {
    margin-bottom: 20px;
}
.search-input {
    width: 100%;
    padding: 12px 20px;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: white;
    font-size: 16px;
    outline: none;
}
.search-input:focus {
    border-color: var(--gold);
}
.table-container {
    overflow-x: auto;
    padding: 20px;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.admin-table th, .admin-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.admin-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
}
.admin-table th:hover {
    color: var(--gold);
}
.btn-action {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.btn-action:hover {
    background: rgba(255,255,255,0.1);
}

/* Fix select dropdown options lisibilite */
.admin-tools .btn-primary,
#create-license-panel .btn-primary,
#renew-modal .btn-primary {
    width: auto;
    margin-top: 0;
}

/* --- HOW TO USE (MODE D'EMPLOI) --- */
.htu-section {
    margin-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 15px;
}

.htu-toggle {
    display: block;
    width: 100%;
    text-align: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s;
}

.htu-toggle:hover {
    background: var(--gold);
    color: #000;
}

.htu-content {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.05);
    font-size: 14px;
    color: #ddd;
    line-height: 1.5;
}

.htu-block {
    margin-bottom: 20px;
}

.htu-block:last-child {
    margin-bottom: 0;
}

.htu-subtitle {
    font-size: 16px;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(197, 160, 89, 0.2);
    padding-bottom: 5px;
}

.htu-step-title {
    font-weight: 600;
    color: #fff;
    margin-top: 10px;
    margin-bottom: 5px;
}

.htu-steps {
    list-style-position: outside;
    margin-left: 20px;
}

.htu-steps li {
    margin-bottom: 8px;
}

.htu-sub {
    display: block;
    font-size: 13px;
    color: #aaa;
    margin-top: 2px;
}

.htu-path {
    display: inline-block;
    background: rgba(0,0,0,0.5);
    color: var(--gold);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    margin-top: 4px;
    word-break: break-all;
}

select.search-input {
    background: #1e1e2e;
    color: white;
    cursor: pointer;
}

select.search-input option {
    background: #1e1e2e;
    color: white;
}

.admin-tools {
    display: flex;
    align-items: center;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: rgba(20, 20, 30, 0.95);
    padding: 30px;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.close-btn {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 24px;
    color: #aaa;
    cursor: pointer;
}

.close-btn:hover {
    color: white;
}

/* Landing Header */
.landing-header {
    width: 100%;
    padding: 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: rgba(18, 18, 18, 0.4);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--card-border);
    z-index: 10;
}

.landing-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.landing-links a {
    text-decoration: none;
    color: var(--text-main);
    padding: 10px 24px;
    border: 1px solid var(--gold);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    background: rgba(197, 160, 89, 0.1);
}

.landing-links a:hover {
    background: var(--gold);
    color: var(--bg-color);
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.4);
    transform: translateY(-2px);
}

.landing-note {
    font-size: 15px;
    color: var(--text-muted);
    text-align: center;
    max-width: 800px;
}

.landing-note strong {
    color: var(--gold);
}

.lang-flag.active {
    opacity: 1 !important;
    transform: scale(1.1);
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.5));
}


/* Split Layout & Carousel */
.login-split-layout {
    display: flex;
    flex-direction: row;
    gap: 60px;
    width: 100%;
    max-width: 1200px;
    margin: auto;
    padding: 40px 20px;
    align-items: center;
    justify-content: center;
}

.login-presentation {
    flex: 1;
    min-width: 300px;
    max-width: 550px;
    color: white;
    position: relative;
}

.carousel-slide {
    animation: fadeInSlide 0.8s ease forwards;
}

.carousel-slide h2 {
    font-size: 32px;
    color: var(--gold);
    margin-bottom: 15px;
    font-weight: 600;
    line-height: 1.2;
}

.carousel-slide p {
    font-size: 16px;
    color: #ddd;
    line-height: 1.6;
    margin-bottom: 20px;
}

.carousel-media-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(197, 160, 89, 0.2);
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.carousel-media-container iframe,
.carousel-media-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

@keyframes fadeInSlide {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOutSlide {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

.carousel-slide.fade-out {
    animation: fadeOutSlide 0.5s ease forwards;
}

/* Responsive Split Layout */
@media (max-width: 900px) {
    .login-split-layout {
        flex-direction: column;
        gap: 30px;
        padding-top: 100px; /* Leave space for the top header */
    }
    
    .login-presentation {
        text-align: center;
    }
}

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    gap: 20px;
    border-bottom: 2px solid rgba(197, 160, 89, 0.1);
    margin-bottom: 30px;
}
.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 600;
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: -2px;
}
.tab-btn:hover {
    color: white;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}
.tab-btn.active {
    color: #ffffff;
    border-bottom: 2px solid var(--gold);
    text-shadow: 0 0 10px rgba(197, 160, 89, 0.5);
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* News Section Cards & Marquee Container */
.news-marquee-container {
    padding: 20px 0 !important;
    position: relative;
    overflow: hidden; /* Hide horizontal scrollbar completely */
    width: 100%;
}

#news-content {
    display: flex;
    gap: 20px;
    width: 100%;
    overflow-x: hidden;
    padding: 10px 0;
    user-select: none;
}

.news-card {
    min-width: 240px;
    max-width: 240px;
    background: rgba(25, 25, 30, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    flex: 0 0 auto;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

.news-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--gold);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px var(--gold-glow);
}

.news-card h3 {
    margin: 0 0 10px 0;
    color: var(--gold-light);
    font-size: 15px;
    font-weight: 600;
}

.news-card p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-media {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.admin-table tbody tr.animate-in {
    opacity: 0;
    animation: slideUpFade 0.4s ease forwards;
}

