/* MangaHub - Style adapté du composant React */

:root {
    --bg-primary: #0a0a0c;
    --bg-secondary: #13131a;
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #64748b;
    --accent-cyan: #06b6d4;
    --accent-blue: #3b82f6;
    --accent-indigo: #6366f1;
    --accent-yellow: #facc15;
    --accent-emerald: #10b981;
    --accent-red: #ef4444;
    --border-subtle: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(10, 10, 12, 0.8);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: rgba(6, 182, 212, 0.3);
}

/* Background Effects */
.background-effects {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    animation: pulse-slow 8s ease-in-out infinite;
}

.bg-blob-1 {
    top: -20%;
    left: -10%;
    width: 800px;
    height: 800px;
    background: rgba(99, 102, 241, 0.1);
}

.bg-blob-2 {
    bottom: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: rgba(6, 182, 212, 0.1);
    animation-delay: 2s;
}

@keyframes pulse-slow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.navbar-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 1rem;
}

@media (min-width: 768px) {
    .navbar-content {
        flex-direction: row;
    }
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    position: relative;
    z-index: 10;
}

.logo-icon-wrapper {
    position: relative;
}

.logo-icon-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
    border-radius: 0.75rem;
    filter: blur(8px);
    opacity: 0.4;
    transition: opacity 0.5s;
}

.logo:hover .logo-icon-glow {
    opacity: 1;
}

.logo-icon-bg {
    position: relative;
    background: #0f172a;
    padding: 0.625rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-icon-svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--accent-cyan);
}

.logo-content {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #ffffff, #ccfbf1, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text-accent {
    color: var(--accent-cyan);
    -webkit-text-fill-color: var(--accent-cyan);
}

.logo-subtitle {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-left: 2px;
}

.subtitle-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-cyan);
}

/* Search Bar */
.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--text-muted);
    transition: color 0.3s;
    pointer-events: none;
}

.search-wrapper:focus-within .search-icon {
    color: var(--accent-cyan);
}

.search-input {
    width: 100%;
    padding: 0.75rem 5rem 0.75rem 2.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all 0.3s;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: transparent;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.5);
}

.search-kbd {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-subtle);
    font-size: 0.625rem;
    color: var(--text-muted);
    font-family: monospace;
}

/* Source Tabs */
.source-tabs {
    display: flex;
    align-items: center;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(12px);
}

.source-tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.source-tab:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.source-tab.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.tab-icon {
    width: 0.875rem;
    height: 0.875rem;
}

.source-tab.active .tab-icon {
    color: var(--accent-cyan);
}

.source-tab[data-source="ygg"].active .tab-icon {
    color: var(--accent-yellow);
}

.tab-count {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.2);
}

.source-tab.active .tab-count {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
}

.source-tab[data-source="ygg"].active .tab-count {
    background: rgba(250, 204, 21, 0.2);
    color: var(--accent-yellow);
}

/* Main Content */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    position: relative;
    z-index: 10;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 0;
    gap: 1rem;
}

.loading-state.hidden {
    display: none;
}

.loading-spinner-wrapper {
    position: relative;
}

.loading-spinner {
    width: 4rem;
    height: 4rem;
    border: 4px solid rgba(6, 182, 212, 0.3);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--accent-cyan);
    animation: pulse 2s ease-in-out infinite;
}

.loading-text {
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    animation: pulse 2s ease-in-out infinite;
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Releases Grid */
.releases-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .releases-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .releases-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .releases-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Release Card */
.release-card {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 1rem;
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

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

.release-card:hover {
    transform: translateY(-0.5rem);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.release-card.source-nyaa:hover {
    border-color: rgba(6, 182, 212, 0.5);
    box-shadow: 0 20px 40px rgba(6, 182, 212, 0.2);
}

.release-card.source-ygg:hover {
    border-color: rgba(250, 204, 21, 0.5);
    box-shadow: 0 20px 40px rgba(250, 204, 21, 0.2);
}

/* Source Badge */
.source-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 20;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.source-badge.nyaa {
    color: var(--accent-cyan);
}

.source-badge.ygg {
    color: var(--accent-yellow);
}

.source-badge svg {
    width: 0.75rem;
    height: 0.75rem;
}

/* Cover Area */
.card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;  /* Standard manga cover ratio */
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(6, 182, 212, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-secondary) 0%, transparent 40%);
    z-index: 10;
    opacity: 0.6;
    pointer-events: none;
}

.card-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;  /* Back to cover for better fill */
    object-position: center top;  /* Focus on top of cover */
    transition: opacity 0.3s, filter 0.3s;
    opacity: 0.85;
    filter: brightness(0.9);
}

.release-card:hover .card-cover-img {
    opacity: 1;
    filter: brightness(1);
}

.card-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.1;
}

.card-cover-placeholder svg {
    width: 4rem;
    height: 4rem;
}

/* Card Content */
.card-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 20;
    margin-top: -2.5rem;
}

.card-size-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1.375;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s;
}

.release-card:hover .card-title {
    color: var(--text-primary);
}

/* Card Footer */
.card-footer {
    margin-top: auto;
    padding-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-subtle);
}

.card-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-group {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 0.875rem;
    font-weight: 700;
}

.stat-value.seeders-high {
    color: var(--accent-emerald);
}

.stat-value.seeders-low {
    color: var(--accent-red);
}

.stat-value.leechers {
    color: var(--text-muted);
}

.stat-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.stat-divider {
    width: 1px;
    height: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
}

.card-action {
    padding: 0.625rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-action:hover {
    transform: scale(1.1);
    color: var(--text-primary);
}

.card-action:active {
    transform: scale(0.95);
}

.source-nyaa .card-action:hover {
    background: linear-gradient(to right, var(--accent-cyan), var(--accent-blue));
}

.source-ygg .card-action:hover {
    background: linear-gradient(to right, var(--accent-yellow), #f97316);
}

.card-action svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8rem 0;
    color: var(--text-muted);
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    width: 4rem;
    height: 4rem;
    opacity: 0.2;
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.empty-subtitle {
    font-size: 0.875rem;
}

/* Footer Status */
.status-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 12, 0.9);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    padding: 0.5rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.625rem;
    color: var(--text-muted);
    z-index: 50;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 10px var(--accent-emerald);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-right {
    display: flex;
    gap: 1rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.status-value {
    color: var(--text-secondary);
}

.status-active {
    color: var(--accent-emerald);
}

.status-warning {
    color: var(--accent-yellow);
}

.status-ygg {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.status-icon-warning {
    width: 0.75rem;
    height: 0.75rem;
    color: var(--accent-yellow);
}

.hidden {
    display: none !important;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    max-width: 900px;
    width: calc(100% - 2rem);
    max-height: calc(100vh - 4rem);
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.3s ease-out;
}

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

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

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(100vh - 4rem);
}

.modal-cover {
    flex-shrink: 0;
    width: 250px;
}

.modal-cover img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.modal-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.4;
}

.modal-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge.new {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-emerald);
}

.badge.language {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.badge.quality {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
}

.badge.source-nyaa {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
}

.badge.source-ygg {
    background: rgba(250, 204, 21, 0.2);
    color: var(--accent-yellow);
}

.modal-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 700;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.info-value.seeders {
    color: var(--accent-emerald);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: white;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-cyan);
}

/* Notification */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--accent-emerald);
    color: white;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

/* Responsive */
@media (max-width: 768px) {
    .status-footer {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .status-right {
        flex-direction: column;
        gap: 0.25rem;
    }
}
