@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

:root {
    /* Brand Colors */
    --primary-color: #6C5CE7;
    --secondary-color: #A29BFE;
    --accent-color: #FF7675;

    /* Layout Colors (Light Theme) */
    --bg-color: #F8F9FE;
    --surface-color: #FFFFFF;
    --surface-glass: rgba(255, 255, 255, 0.85);
    --text-main: #2D3436;
    --text-muted: #636E72;
    --border-color: #f1f2f6;
    --input-bg: #f1f2f6;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    --hover-shadow: 0 15px 35px rgba(108, 92, 231, 0.1);
}

[data-theme="dark"] {
    /* Layout Colors (Dark Theme) */
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --surface-glass: rgba(30, 30, 30, 0.85);
    --text-main: #E0E0E0;
    --text-muted: #A0A0A0;
    --border-color: #2c2c2c;
    --input-bg: #2d2d2d;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    --hover-shadow: 0 15px 35px rgba(108, 92, 231, 0.25);

    /* Tweaking accents for better contrast on dark */
    --primary-color: #8378ea;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), color 0.3s ease;
    line-height: 1.6;
}

main {
    min-height: 100vh;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    z-index: 9999;
    width: 0%;
    pointer-events: none;
    contain: layout style;
    will-change: width;
}

/* Breadcrumb dark mode */
[data-theme="dark"] .breadcrumb-nav {
    border-color: var(--border-color) !important;
    background-color: var(--input-bg) !important;
}

/* Selection color */
::selection {
    background: var(--primary-color);
    color: #fff;
}

/* Premium Header & Brand */
.premium-navbar {
    background-color: var(--surface-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    /* Safari support */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 0.8rem 0;
    transition: background-color 0.3s ease;
}

.brand-logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
    transition: color 0.3s ease;
}

.nav-link {
    color: var(--text-main) !important;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* ===== Mega Dropdown ===== */
.premium-navbar .container {
    position: relative;
}

.mega-dropdown {
    border-top: 2px solid var(--accent-color);
    top: 100%;
    margin-top: 10px !important;
    padding: 20px 24px !important;
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
}

.mega-dropdown::-webkit-scrollbar {
    width: 6px;
}

.mega-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.mega-dropdown::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 3px;
}

.mega-cat-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.mega-cat-item {
    transition: all 0.15s ease;
    cursor: pointer;
    padding: 10px 6px !important;
    border-radius: 10px;
}

.mega-cat-item:hover {
    background: var(--input-bg);
    transform: translateY(-2px);
}

.mega-cat-img {
    width: 76px;
    height: 76px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--border-color);
    transition: transform 0.15s, border-color 0.15s;
}

.mega-cat-item:hover .mega-cat-img {
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.mega-cat-placeholder {
    width: 76px;
    height: 76px;
    border-radius: 12px;
    background: var(--input-bg);
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-muted);
}

.mega-cat-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
    width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.mega-cat-item:hover .mega-cat-name {
    color: var(--accent-color);
}

/* Theme Toggle Button */
.theme-toggle {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s, color 0.3s;
    background-color: var(--input-bg) !important;
    /* using !important to override inline if any */
    color: var(--text-main) !important;
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

/* Search Bar (Mobile + Desktop) */
.search-form {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 220px;
}

.search-input {
    border-radius: 30px 0 0 30px;
    border-right: 0;
    padding-left: 20px;
    background-color: var(--input-bg);
    border: 1px solid transparent;
    color: var(--text-main);
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.search-input:focus {
    background-color: var(--surface-color);
    border-color: var(--secondary-color);
    color: var(--text-main);
    box-shadow: none;
}

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

.form-control::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.7;
}

.search-btn {
    border-radius: 0 30px 30px 0;
    background-color: var(--input-bg);
    border-left: 0;
    color: var(--accent-color);
    border: 1px solid transparent;
    transition: background-color 0.3s, border-color 0.3s;
}

.search-input:focus+.search-btn {
    background-color: var(--surface-color);
    border-color: var(--secondary-color);
    border-left: 0;
}

/* Printables Card Architecture */
.printable-card {
    background: var(--surface-color);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.printable-card:hover {
    transform: translate3d(0, -8px, 0);
    box-shadow: var(--hover-shadow);
    border-color: var(--secondary-color);
}

/* ===== Category Banner ===== */
.category-banner {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    height: 200px;
}

.category-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 30%, rgba(0, 0, 0, 0.7));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
}

.category-banner-overlay h1 {
    font-size: 1.8rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
    .category-banner {
        height: 260px;
    }

    .category-banner-overlay h1 {
        font-size: 2.4rem;
    }
}

.printable-card .badge-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--surface-glass);
    backdrop-filter: blur(5px);
    color: var(--primary-color);
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    z-index: 10;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.3s;
}
/* Shimmer Loading Effect */
.shimmer-wrapper {
    position: relative;
    overflow: hidden;
    background-color: var(--input-bg);
}

.shimmer-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer-anim 1.5s infinite;
    z-index: 1;
}

[data-theme="dark"] .shimmer-wrapper::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
}

@keyframes shimmer-anim {
    0% { left: -150%; }
    100% { left: 150%; }
}

.shimmer-wrapper img {
    opacity: 0;
    transition: opacity 0.4s ease-in;
}

.shimmer-wrapper.loaded::before {
    display: none;
    animation: none;
}

.shimmer-wrapper.loaded img {
    opacity: 1;
}

.printable-card>a {
    display: block;
    aspect-ratio: 1 / 1;
    min-height: 0;
}

.printable-card img {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.3s;
}

[data-theme="dark"] .printable-card img {
    /* Dim images slightly in dark mode if they are too bright (like white coloring pages) */
    filter: brightness(0.9);
}

.printable-card:hover img {
    transform: scale(1.05);
    filter: brightness(1);
}

/* Premium Tags */
.tag-btn {
    background-color: var(--input-bg);
    color: var(--text-main);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 8px 18px;
    margin: 0 5px 8px 0;
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid transparent;
}

.tag-btn:hover {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(255, 118, 117, 0.25);
}

/* Single Page & CTA */
.btn-cta-download {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: 800;
    padding: 18px 40px;
    box-shadow: 0 10px 25px rgba(0, 184, 148, 0.35);
    transition: all 0.3s ease;
    animation: pulse-soft 2.5s infinite;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .btn-cta-download {
    color: #fff;
}

.btn-cta-download:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 184, 148, 0.5);
    color: #fff;
}

@keyframes pulse-soft {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(0, 184, 148, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 184, 148, 0);
    }
}

/* Single Page Info Text */
.seo-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.seo-content strong {
    color: var(--text-main);
}

/* Rating Box UI Restyle */
.rating-module {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: background-color 0.3s, border-color 0.3s;
}

.star-rating {
    font-size: 2.2rem;
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: center;
}

.star-rating input {
    display: none;
}

.star-rating label {
    color: #ccc;
    cursor: pointer;
    transition: color 0.2s ease-in-out, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0 4px;
}

[data-theme="dark"] .star-rating label {
    color: #444;
}

.star-rating label:hover,
.star-rating label:hover~label,
.star-rating input:checked~label {
    color: #f1c40f;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.4);
}

.star-rating label:hover {
    transform: scale(1.2);
}

/* Breadcrumbs & Forms */
.breadcrumb-item a {
    color: var(--primary-color);
    font-weight: 600;
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

.breadcrumb-item+.breadcrumb-item::before {
    color: var(--text-muted);
}

/* Gradient Action Button (Oluştur & Keşfet vb.) */
.btn-generate {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff !important;
    border: none;
    border-radius: 50px;
    font-weight: 800;
    padding: 14px 28px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.35);
    color: #fff !important;
}

.btn-generate:disabled {
    opacity: 0.7;
    transform: none;
    cursor: not-allowed;
}

.bg-light {
    background-color: var(--input-bg) !important;
}

.text-dark {
    color: var(--text-main) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.border-bottom,
.border-top {
    border-color: var(--border-color) !important;
}

/* Footer Premium */
footer {
    background-color: var(--surface-color);
    color: var(--text-muted);
    border-top: 3px solid var(--primary-color);
    margin-top: 2rem;
    padding: 2rem 0 1.5rem;
    transition: background-color 0.3s, border-color 0.3s;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s, transform 0.2s;
    display: inline-block;
}

footer a:hover {
    color: var(--secondary-color);
    transform: translateY(-1px);
}

/* Scroll to Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.3s;
    z-index: 999;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

/* Pagination Adjustments for Theme */
.pagination .page-link {
    background-color: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-main);
}

.pagination .page-link:hover {
    background-color: var(--input-bg);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    background-color: var(--input-bg);
    color: var(--text-muted);
    border-color: var(--border-color);
}

/* Mobile-First Tweaks (A11y & Touch targets) */
a,
button,
input.form-control {
    min-height: 44px;
    /* Apple/Google 44px touch target rule */
}

@media (max-width: 1199.98px) {
    .premium-navbar {
        padding: 0.5rem 0;
    }

    .premium-navbar .container {
        justify-content: center;
    }

    .search-form {
        margin-top: 1rem;
        max-width: 100%;
    }

    .btn-cta-download {
        width: 100%;
    }

    .theme-toggle {
        margin-top: 15px !important;
    }

    h1.display-4,
    h1.display-5 {
        font-size: 1.8rem;
    }

    .category-showcase h2 {
        font-size: 1.1rem;
    }
}

/* Dropdown menu polish */
.dropdown-menu {
    border: 1px solid var(--border-color) !important;
    animation: dropdownFade 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--input-bg) !important;
    color: var(--primary-color) !important;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Category section title accent */
.category-showcase h2 .bi-bookmark-star-fill {
    transition: transform 0.3s ease;
}

.category-showcase:hover h2 .bi-bookmark-star-fill {
    transform: scale(1.15) rotate(-5deg);
}


/* Floating Favorite & Trash Buttons (Global) */
.btn-favorite-float {
    top: 15px;
    right: 15px;
    z-index: 10;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-muted);
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    text-decoration: none;
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-favorite-float:hover {
    background: #fff;
    transform: scale(1.1);
    color: var(--bs-danger);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.btn-favorite-float.active {
    color: #ff4757;
}

.btn-favorite-float.active i::before {
    content: "\f415";
    /* bi-heart-fill */
}

/* Dark theme overrides for floating buttons */
[data-theme="dark"] .btn-favorite-float {
    background: rgba(30, 30, 30, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .btn-favorite-float:hover {
    background: rgba(45, 45, 45, 1);
    color: #ff4757;
}

[data-theme="dark"] .btn-favorite-float.active {
    color: #ff4757;
}




/* =========================================
   PRINT STYLES (@media print)
   ========================================= */
@media print {
    @page { 
        margin: 0; 
        size: auto; 
    }

    /* Hide everything by default */
    body * {
        visibility: hidden !important;
    }

    /* Reset background and text colors, force 1 page height */
    body {
        background-color: #fff !important;
        background-image: none !important;
        margin: 0 !important;
        padding: 0 !important;
        height: 100vh !important;
        overflow: hidden !important;
    }

    /* Only show the printable image container */
    #printable-area,
    #printable-area * {
        visibility: visible !important;
    }

    #printable-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100vw !important;
        height: 100vh !important;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
        page-break-after: avoid !important;
        page-break-before: avoid !important;
        break-inside: avoid !important;
    }

    #printable-area img {
        max-width: 100vw !important;
        max-height: 100vh !important;
        width: auto !important;
        height: auto !important;
        /* Fit within one page vertically */
        object-fit: contain !important;
        box-shadow: none !important;
        border: none !important;
        margin: 0 auto !important;
        page-break-inside: avoid !important;
    }

    /* Ensure specific sections dont take space */
    nav,
    header,
    footer,
    .btn-cta-download,
    .rating-module,
    .breadcrumb,
    .seo-content,
    .tag-btn,
    .navbar,
    .card-header {
        display: none !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    .ad-container {
        display: none !important;
    }
}

/* ===== Ad Containers ===== */
.ad-container {
    text-align: center;
    margin: 16px auto;
    overflow: hidden;
    max-width: 100%;
}

.ad-placeholder {
    background: repeating-linear-gradient(
        45deg,
        var(--input-bg),
        var(--input-bg) 10px,
        var(--border-color) 10px,
        var(--border-color) 20px
    );
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 20px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .ad-placeholder {
    border-color: rgba(255, 255, 255, 0.1);
}

.ad-mobile-only {
    display: none;
}

.ad-desktop-only {
    display: block;
}

@media (max-width: 767.98px) {
    .ad-mobile-only {
        display: block;
    }

    .ad-desktop-only {
        display: none;
    }
}

.ad-sticky-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: var(--surface-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 4px 0;
    margin: 0;
}

@media (min-width: 768px) {
    .ad-sticky-bottom {
        display: none !important;
    }
}

/* Mobil alt nav ile çakışmasın */
@media (max-width: 1199.98px) {
    .ad-sticky-bottom {
        bottom: 60px;
    }
}

/* ===== Native In-Grid Ad Cards ===== */
.native-ad-card {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.native-ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    padding: 20px;
    background: repeating-linear-gradient(
        45deg,
        var(--input-bg),
        var(--input-bg) 8px,
        var(--border-color) 8px,
        var(--border-color) 16px
    );
    text-align: center;
    color: var(--text-muted);
}

.native-ad-placeholder i {
    font-size: 1.8rem;
    opacity: 0.4;
    margin-bottom: 8px;
}

.native-ad-placeholder span {
    font-weight: 700;
    font-size: 0.82rem;
    display: block;
}

.native-ad-placeholder small {
    font-size: 0.68rem;
    opacity: 0.6;
    margin-top: 4px;
    display: block;
}