/* ==========================================================================
   NOVAFANSUB - MOBİL UYUMLU (RESPONSIVE) STİLLER
   Masaüstü tasarımı korunur; sadece mobil/tablet için düzenlemeler.
   Breakpoints: 1200px (hamburger), 768px, 480px
   ========================================================================== */

/* Genel: yatay taşmayı önle, safe area (çentikli ekran) */
html {
    overflow-x: hidden;
    max-width: 100vw;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Esnek birimler - sabit px genişlikleri max-width ile sınırlandırma */
.nova-container,
.nova-wrapper,
.info-wrapper,
.content-wrapper {
    max-width: 100%;
    box-sizing: border-box;
}

.nova-container {
    max-width: 1400px;
}

.nova-wrapper {
    max-width: 1400px;
}

.info-wrapper {
    max-width: 1400px;
}

.content-wrapper {
    max-width: 1400px;
}

/* Hamburger butonu - sadece mobilde görünür, sağ üst sabit */
.nova-hamburger {
    display: none;
    flex-direction: column;
    pointer-events: auto;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 0, 85, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    z-index: 1003;
    position: relative;
}

.nova-hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: #ff0055;
    border-radius: 2px;
    transition: 0.3s;
}

.nova-hamburger:hover {
    border-color: #ff0055;
    background: rgba(255, 0, 85, 0.1);
}

.nova-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nova-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.nova-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.nova-nav-auth {
    display: none;
}

/* ==========================================================================
   MOBİL - 1200px ve altı (hamburger görünür)
   ========================================================================== */
@media (max-width: 1200px) {
    .nova-hamburger {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: fixed !important;
        top: 12px !important;
        right: 15px !important;
        z-index: 1005 !important;
    }

    .nova-container {
        padding-right: 65px;
    }

    .header-right {
        display: none !important;
    }

    .nova-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(10px);
        z-index: 1004;
        pointer-events: auto;
        padding: 80px 20px 20px;
        transition: right 0.3s ease;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
        border-left: 1px solid rgba(255, 0, 85, 0.3);
    }

    body.nova-menu-open .nova-nav {
        right: 0 !important;
    }

    .nova-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .nova-nav ul li a,
    .nova-nav a {
        padding: 15px;
        border-bottom: 1px solid #222;
        font-size: 16px;
    }

    .nova-nav-auth {
        display: flex !important;
        flex-direction: column;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #333;
    }

    .nova-nav-auth .auth-btn {
        margin-bottom: 8px;
        text-align: center;
        padding: 12px 15px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobil menü içi arama (single-seriler vb.) */
    .nova-nav-auth .nav-search-mobile {
        width: 100%;
        margin-bottom: 12px;
    }

    .nova-nav-auth .nav-search-mobile input {
        width: 100% !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Overlay - header (1000) altında olmalı ki nav linkleri tıklanabilsin */
    .nova-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        z-index: 999;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s;
    }

    body.nova-menu-open .nova-menu-overlay {
        display: block;
        pointer-events: auto;
        opacity: 1;
    }

    /* Sidebar gizle, içerik tam genişlik */
    .nova-sidebar {
        display: none !important;
    }

    .nova-content {
        flex: 0 0 100% !important;
        min-width: 0;
    }

    /* single-seriler.php - info-wrapper: sidebar-right gizle, sidebar-left sadece kapak göster */
    .sidebar-right {
        display: none !important;
    }

    .sidebar-left {
        flex: 1 1 100%;
        order: -1;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        min-width: 0;
        max-width: 100%;
    }

    .sidebar-left .meta-box {
        display: none;
    }

    .main-column {
        flex: 1 1 100%;
        min-width: 0;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .info-wrapper {
        flex-direction: column;
        padding: 0 15px;
        min-width: 0;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    /* single-seriler: metin taşmasın, alta kaysın */
    .series-title {
        font-size: 24px !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        max-width: 100%;
    }

    .nova-genres-container {
        flex-wrap: wrap !important;
        gap: 8px;
        max-width: 100%;
    }

    .genre-item {
        max-width: 100%;
        word-break: break-word;
    }

    .series-summary {
        max-width: 100%;
        overflow-x: hidden;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        box-sizing: border-box;
    }

    .series-summary *,
    .series-summary p {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .quick-nav {
        flex-direction: column;
        max-width: 100%;
    }

    .q-btn {
        min-width: 0;
        max-width: 100%;
    }

    .section-title {
        font-size: 16px;
        padding: 10px 15px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .chapter-grid {
        max-width: 100%;
        overflow-x: hidden;
        padding: 15px;
        box-sizing: border-box;
    }

    .chapter-box {
        min-width: 0;
        max-width: 100%;
        flex-wrap: wrap;
    }

    .chapter-box .ch-name {
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        min-width: 0;
    }

    .similar-grid {
        max-width: 100%;
        overflow-x: hidden;
    }

    .small-card {
        min-width: 0;
        overflow: hidden;
    }

    .small-card h3 {
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        font-size: 11px !important;
    }

    .series-cover {
        max-width: 220px;
        width: 100%;
        margin: 0 auto 20px;
        min-width: 0;
    }

    .series-cover img {
        width: 100% !important;
        height: auto !important;
        max-height: 350px !important;
        object-fit: cover !important;
    }

    /* Grid düzenlemeleri - index.php Son Güncellenenler ile aynı görünüm */
    .nova-manga-grid,
    .series-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }

    .nova-cover,
    .card-cover {
        height: 180px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .nova-cover img,
    .card-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Slider mobil - responsive, taşmasın */
    .nova-slider-section {
        height: 320px;
        overflow: hidden;
    }

    .slide-content-container {
        flex-direction: column;
        padding: 0 15px;
        text-align: center;
    }

    .slide-title {
        font-size: 20px;
    }

    .slide-cover {
        display: flex !important;
        justify-content: center;
    }

    .slide-cover img {
        width: 120px !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 180px !important;
        object-fit: cover !important;
    }

    /* Header search mobil */
    .header-search input {
        width: 140px;
        max-width: 100%;
    }

    .header-search input:focus {
        width: 160px;
    }

    /* Chapter grid (single-seriler) */
    .chapter-grid {
        grid-template-columns: 1fr;
    }

    .similar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .small-card img {
        height: 120px;
    }

    /* Featured section (page-yaoi, page-yuri, page-18) */
    .nova-featured-static,
    .featured-content {
        flex-direction: column;
        padding: 20px 15px;
    }

    .feat-cover {
        width: 100%;
        max-width: 200px;
        height: auto;
    }

    .featured-content {
        gap: 25px;
    }
}

/* ==========================================================================
   EK KÜÇÜK EKRAN (480px ve altı) – Tam mobil uyum
   ========================================================================== */
@media (max-width: 480px) {
    .nova-container {
        padding-left: 12px;
        padding-right: 60px; /* Hamburger için boşluk */
    }

    .nova-logo img {
        max-height: 42px;
    }

    .nova-wrapper,
    .info-wrapper {
        margin-left: auto;
        margin-right: auto;
        padding-left: 12px;
        padding-right: 12px;
    }

    .nova-manga-grid,
    .series-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .nova-cover,
    .card-cover {
        height: 160px;
    }

    .nova-info h3,
    .nova-info h3 a {
        font-size: 12px !important;
    }

    .nova-slider-section {
        height: 280px;
    }

    .slide-title {
        font-size: 16px;
    }

    .slide-cover img {
        width: 90px !important;
        max-height: 140px !important;
    }

    .slide-btn {
        padding: 10px 20px;
        font-size: 12px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nova-title {
        font-size: 14px;
        padding-left: 10px;
    }

    .nova-pagination a,
    .nova-pagination span {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nova-custom-footer,
    .nova-footer {
        padding: 24px 12px;
        font-size: 12px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }

    .nova-announcement-box {
        padding: 12px !important;
    }

    .series-title {
        font-size: 20px !important;
    }

    .series-summary {
        padding: 15px;
    }

    .chapter-grid {
        padding: 12px;
    }

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

    .q-btn {
        min-height: 48px;
        padding: 12px 15px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .similar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .small-card img {
        height: 100px;
    }

    .rank-name {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nova-rank-item {
        padding: 8px 10px;
    }

    .rank-cover {
        width: 50px;
        height: 70px;
    }

    .nova-nav {
        width: 260px;
        padding: 70px 15px 15px;
    }

    .nova-hamburger {
        top: 10px !important;
        right: 10px !important;
        width: 42px;
        height: 42px;
    }
}

/* Dokunma hedefleri: tıklanabilir alanlar en az 44px */
@media (max-width: 1200px) {
    .nova-nav ul li a,
    .nova-nav a {
        min-height: 48px;
        display: flex;
        align-items: center;
        padding: 14px 15px;
    }

    .card-ch-item,
    .chapter-box {
        min-height: 44px;
        padding: 12px 15px;
    }

    .nova-card a,
    .small-card a {
        display: block;
        min-height: 44px;
    }
}

/* card-ch-item – mobilde daha kompakt olsun */
@media (max-width: 768px) {
    .card-ch-item {
        padding: 6px 10px;
        min-height: 34px;
    }
    .card-ch-item .ch-no {
        font-size: 11px;
    }
    .card-ch-item .ch-date,
    .card-ch-item .ch-badge-new {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .card-ch-item {
        padding: 5px 8px;
        min-height: 30px;
    }
}