/* ================================
   UNIVERSANIME TRACKER - STYLE CSS
   Inspiré de YggTorrent
   ================================ */

:root {
    /* Palette fusion ADN/Wakanim/Crunchyroll/YggTorrent */
    --primary: #22282f;           /* Arrière-plan principal */
    --secondary: #2e3642;         /* Arrière-plan secondaire - plus clair */
    --accent: #FF6B35;            /* Orange-rouge (ADN + Crunchyroll + YggTorrent) */
    --accent-secondary: #7c3aed;  /* Violet (Wakanim) */
    --orange-wakanim: #F97316;    /* Orange chaud */
    --text-light: #f0f0f0;        /* Texte clair - plus blanc */
    --text-dark: #2c3e50;         /* Texte sombre */
    --border: #ff4600;            /* Bordure orange vif */
    --green: #27ae60;             /* Vert */
    --red: #ef4444;               /* Rouge */
    --yellow: #f39c12;            /* Jaune */
    --blue: #6366f1;              /* Bleu */
    --glow-orange: 255, 107, 53;  /* Pour les effets glow orange */
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.5);  /* Shadow profonde */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ================================
   ANIMATIONS PRINCIPALES
   ================================ */

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(var(--glow-orange), 0.3), 0 0 20px rgba(124, 58, 237, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(var(--glow-orange), 0.6), 0 0 40px rgba(124, 58, 237, 0.4);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes hoverGlow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(var(--glow-orange), 0.5), 0 0 10px rgba(124, 58, 237, 0.3);
    }
    50% {
        text-shadow: 0 0 10px rgba(var(--glow-orange), 0.8), 0 0 20px rgba(124, 58, 237, 0.5);
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

html, body {
    height: 100%;
    display: flex;
    flex-direction: column;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--primary);
    color: var(--text-light);
    line-height: 1.6;
    animation: fadeIn 0.6s ease-in-out;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
    flex: 1;
    width: 100%;
}

/* HEADER */
.header {
    background: linear-gradient(135deg, var(--secondary) 0%, rgba(46, 54, 66, 0.9) 100%);
    border-bottom: 3px solid var(--accent);
    padding: 12px 0;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 25px rgba(var(--glow-orange), 0.15);
    animation: fadeInDown 0.6s ease-out;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.logo-video {
    width: 50px;
    height: 80px;
    border-radius: 0;
    box-shadow: 0 0 10px rgba(var(--glow-orange), 0.5), 0 0 20px rgba(124, 58, 237, 0.3);
    flex-shrink: 0;
    transition: all 0.3s ease;
    object-fit: contain;
}

.logo-image {
    width: 150px;
    height: 60px;
    border-radius: 0;
    /*box-shadow: 0 0 10px rgba(var(--glow-orange), 0.5), 0 0 20px rgba(124, 58, 237, 0.3);*/
    flex-shrink: 0;
    transition: all 0.3s ease;
    object-fit: contain;
}

.logo-video:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 0 20px rgba(var(--glow-orange), 0.8), 0 0 40px rgba(124, 58, 237, 0.5);
}

.header h1 {
    font-size: 24px;
    margin: 0;
}

.header h1 a {
    color: var(--accent);
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    animation: slideInLeft 0.6s ease-out;
}

.header h1 a:hover {
    text-decoration: underline;
    animation: hoverGlow 1.5s ease-in-out infinite;
}

.header nav {
    flex: 1;
    text-align: right;
}

.header nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin: 0;
}

.header nav a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 15px;
    border-radius: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.header nav a:hover {
    background: linear-gradient(135deg, var(--accent) 0%, rgba(255, 107, 53, 0.8) 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--glow-orange), 0.4);
}

/* SEARCH BOX */
.search-box {
    background-color: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 40px;
    margin-bottom: 50px;
}

.search-box h2 {
    font-size: 20px;
    margin-bottom: 30px;
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 15px;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.search-field {
    display: flex;
    flex-direction: column;
}

.search-field label {
    font-size: 12px;
    font-weight: bold;
    color: var(--text-light);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-field input,
.search-field select {
    padding: 12px 15px;
    background-color: var(--primary);
    color: var(--text-light);
    border: 1px solid var(--border);
    border-radius: 0;
    font-size: 14px;
}

.search-field input:focus,
.search-field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(var(--glow-orange), 0.4), 0 0 5px rgba(124, 58, 237, 0.3);
    transition: all 0.3s ease;
    transform: translateY(-2px);
}

.search-options {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-options label {
    display: flex;
    align-items: center;
    font-size: 13px;
    cursor: pointer;
}

.search-options input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.btn-search {
    background: linear-gradient(135deg, var(--accent) 0%, rgba(255, 107, 53, 0.85) 100%);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 0;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    animation: scaleUp 0.5s ease-out;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(var(--glow-orange), 0.3);
}

.btn-search::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-search:active::before {
    width: 200px;
    height: 200px;
}

.btn-search:hover {
    background: linear-gradient(135deg, #F97316 0%, var(--accent) 100%);
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 8px 25px rgba(var(--glow-orange), 0.5), 0 0 30px rgba(124, 58, 237, 0.3);
}

.btn-search:active {
    transform: translateY(-1px) scale(1.04);
}

/* TORRENTS SECTION */
.torrents-section {
    margin-bottom: 60px;
    animation: fadeInUp 0.7s ease-out;
}

.torrents-section h2 {
    font-size: 22px;
    margin-bottom: 30px;
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 15px;
    animation: slideInLeft 0.6s ease-out 0.2s both;
}

.no-results {
    background-color: var(--secondary);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 0;
    text-align: center;
    color: var(--text-light);
}

/* TORRENTS TABLE */
.torrents-table-wrapper {
    overflow-x: auto;
    background-color: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 0;
}

.torrents-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.torrents-table thead {
    background-color: var(--primary);
    border-bottom: 2px solid var(--accent);
}

.torrents-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: bold;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.torrents-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-out;
}

.torrents-table tbody tr:hover {
    background-color: rgba(var(--glow-orange), 0.1);
    transform: translateX(5px);
    box-shadow: inset 2px 0 0 var(--accent);
}

.torrents-table td {
    padding: 10px 8px;
    vertical-align: middle;
    text-align: left;
}

/* COLUMN WIDTHS */
.col-name { width: 35%; }
.col-type { width: 10%; text-align: center; }
.col-version { width: 10%; text-align: center; }
.col-format { width: 10%; text-align: center; }
.col-comments { width: 8%; text-align: center; }
.col-age { width: 8%; text-align: center; }
.col-size { width: 8%; text-align: right; }
.col-completions { width: 8%; text-align: center; }
.col-seeders { width: 7%; text-align: center; }
.col-leechers { width: 7%; text-align: center; }

.format-badge {
    display: inline-block;
    background-color: var(--blue);
    color: white;
    padding: 3px 8px;
    border-radius: 0;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.torrent-link {
    color: var(--blue);
    text-decoration: none;
    font-weight: 500;
    display: block;
    max-width: 400px;
    white-space: normal;
    word-break: break-word;
    transition: all 0.3s ease;
}

.torrent-link:hover {
    color: var(--accent);
    text-decoration: underline;
    text-shadow: 0 0 10px rgba(var(--glow-orange), 0.5);
}

.torrent-meta {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

.torrent-row td.green {
    color: var(--green);
    font-weight: bold;
}

.torrent-row td.red {
    color: var(--red);
    font-weight: bold;
}

/* RIPPLE EFFECT */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

button, .btn-action {
    position: relative;
    overflow: hidden;
}

/* NEWS/POSTS SECTION */
.news-section {
    animation: fadeInUp 0.7s ease-out !important;
}

.post-card {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    animation: scaleUp 0.5s ease-out;
    position: relative;
    overflow: hidden;
    border-radius: 0;
    background: linear-gradient(135deg, rgba(46, 54, 66, 0.9) 0%, rgba(34, 40, 47, 0.7) 100%) !important;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--glow-orange), 0.3), transparent);
    transition: left 0.5s ease;
}

.post-card:hover {
    transform: translateY(-5px) scale(1.02) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 10px 25px rgba(var(--glow-orange), 0.3), 0 0 20px rgba(124, 58, 237, 0.2) !important;
}

.post-card:hover::before {
    left: 100%;
}

/* FOOTER */
.footer {
    background-color: var(--secondary);
    border-top: 3px solid var(--accent);
    padding: 25px 0;
    text-align: center;
    margin-top: auto;
    font-size: 12px;
    color: #999;
    animation: fadeInUp 0.6s ease-out;
    box-shadow: 0 -2px 10px rgba(var(--glow-orange), 0.1);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .search-grid {
        grid-template-columns: 1fr;
    }

    .header nav ul {
        flex-direction: column;
        gap: 10px;
    }

    .torrents-table {
        font-size: 11px;
    }

    .torrents-table th,
    .torrents-table td {
        padding: 8px 4px;
    }

    .col-type { width: 60px; }
    .col-comments { width: 60px; }
    .col-age { width: 60px; }
    .col-size { width: 70px; }
    .col-completions { width: 60px; }
    .col-seeders { width: 60px; }
    .col-leechers { width: 60px; }

    .torrent-link {
        max-width: 200px;
    }
}

/* ================================
   PROFILE BAR - Visible pour utilisateurs connectés
   ================================ */

.admin-profile-bar {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(30, 30, 30, 0.9));
    border-bottom: 2px solid var(--accent);
    padding: 12px 0;
}

.admin-profile-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.admin-stats {
    display: flex;
    gap: 20px;
    flex: 1;
    font-size: 0.85em;
    flex-wrap: wrap;
}

.admin-stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.admin-stat-label {
    color: #aaa;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-stat-value {
    color: var(--accent);
    font-weight: 600;
    font-size: 1em;
}

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

.admin-notifications {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    font-size: 0.9em;
}

.admin-notification-badge {
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
}

.admin-user {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-welcome {
    font-size: 0.9em;
    color: #ddd;
}

.admin-logout {
    padding: 6px 16px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.admin-logout:hover {
    background: #dc2626;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Responsive profile bar */
@media (max-width: 1024px) {
    .admin-stats {
        gap: 15px;
        font-size: 0.85em;
    }
    
    .admin-stat-item {
        min-width: 80px;
    }
}

@media (max-width: 768px) {
    .admin-profile-bar .container {
        flex-direction: column;
        gap: 15px;
        padding: 15px 10px;
    }
    
    .admin-stats {
        width: 100%;
        gap: 10px;
        flex-wrap: wrap;
        font-size: 0.8em;
    }
    
    .admin-user-info {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
    }
}

/* ANIME ACTIONS */
.anime-actions {
    display: flex;
    gap: 10px;
}

.anime-actions a.btn-action,
.anime-actions a.btn-edit,
.anime-actions a.btn-delete {
    flex: 1;
    padding: 10px 15px !important;
    border: 1px solid #4caf50 !important;
    border-radius: 5px !important;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    font-size: 0.95em;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 30px;
    background: rgba(76, 175, 80, 0.3) !important;
    color: #4caf50 !important;
    min-height: 45px;
    white-space: nowrap;
}

.anime-actions a.btn-delete {
    background: rgba(244, 67, 54, 0.3) !important;
    color: #f44336 !important;
    border-color: #f44336 !important;
}

.anime-actions a.btn-delete:hover {
    background: rgba(244, 67, 54, 0.5) !important;
}

/* ================================
   KEYPASS TOGGLE BUTTON
   ================================ */
.keypass-toggle-btn {
    padding: 6px 14px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: 1px solid #2980b9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.keypass-toggle-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.5);
    transform: translateY(-2px);
}

.keypass-toggle-btn:active {
    transform: translateY(0);
}

.keypass-toggle-btn.visible {
    background: linear-gradient(135deg, #27ae60, #229954);
    border-color: #27ae60;
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.3);
}

.keypass-toggle-btn.visible:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.5);
}
