/* Tablet (≤900px) */
@media (max-width: 900px) {
    body {
        font-size: 15px;
    }
    
    .mobile-menu-btn {
        top: 14px;
        left: 14px;
        width: 46px;
        height: 46px;
    }
    
    .mobile-menu-btn span {
        width: 22px;
    }
    
    #page-header {
        padding: 65px 14px 14px 14px;
    }
    
    #page-header.header-fixed {
        padding: 65px 14px 12px 14px;
    }
    
    /* Arama input ve butonlar - daha büyük */
    #page-header #myInput {
        padding: 13px 16px;
        font-size: 15px;
    }
    
    #search-form button,
    #search-form a {
        padding: 13px 18px;
        font-size: 15px;
        min-height: 46px;
    }
    
    /* Auth butonları */
    .auth-button {
        padding: 11px 16px;
        font-size: 14px;
        min-height: 42px;
    }
    
    .content {
        padding: 16px 12px;
    }
    
    .view-btn {
        padding: 11px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .sort-options select {
        padding: 11px 14px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .wrapper {
        margin: 24px auto;
        row-gap: 24px;
    }
    
    /* Better card sizing for tablet */
    .card {
        max-width: 280px;
    }
    
    /* Optimize sidebar for tablet */
    .sidebar {
        max-width: 300px;
    }
    
    body:has(#page-header.header-fixed) .content {
        padding-top: 150px;
    }
}

/* Mobile (≤600px) */
@media (max-width: 600px) {
    body {
        font-size: 14px;
    }
    
    .mobile-menu-btn {
        top: 12px;
        left: 12px;
        width: 42px;
        height: 42px;
    }
    
    .mobile-menu-btn span {
        width: 20px;
    }
    
    #page-header {
        padding: 65px 12px 12px 12px;
    }
    
    #page-header.header-fixed {
        padding: 65px 12px 12px 12px;
    }
    
    #page-header #myInput {
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 10px;
    }
    
    #search-form button,
    #search-form a {
        padding: 10px 14px;
        font-size: 13px;
        border-radius: 8px;
    }
    
    .theme-switch-wrapper {
        font-size: 13px;
    }
    
    .theme-switch {
        height: 28px;
        width: 50px;
    }
    
    .slider:before {
        height: 20px;
        width: 20px;
    }
    
    input:checked + .slider:before {
        transform: translateX(22px);
    }
    
    .auth-button {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 8px;
    }
    
    .view-options strong,
    .sort-options strong {
        font-size: 13px;
    }
    
    .view-btn {
        padding: 7px 12px;
        font-size: 12px;
    }
    
    .sort-options select {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .wrapper {
        margin: 20px auto;
        row-gap: 20px;
        width: 100%;
        column-gap: 12px;
    }
    
    .card {
        border-width: 4px;
        border-radius: 6px;
        max-width: 100%;
    }
    
    .pagelabel,
    .category {
        font-size: 0.65rem;
        padding: 6px 8px;
        border-radius: 4px;
    }
    
    .new,
    .free {
        font-size: 0.65rem;
        padding: 4px 10px;
        top: 14px;
        right: -8px;
    }
    
    .planlabel {
        font-size: 0.7rem;
        padding: 10px 8px;
    }
    
    .favorite-btn {
        width: 36px;
        height: 36px;
        top: 6px;
        right: 6px;
    }
    
    .favorite-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .pagination-container {
        gap: 4px;
        padding: 20px 0;
        margin-top: 24px;
    }
    
    .pagination-container a,
    .pagination-container span {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 12px;
        border-radius: 8px;
    }
    
    body:has(#page-header.header-fixed) .content {
        padding-top: 180px;
    }
    
    /* Sidebar adjustments for mobile */
    .sidebar {
        width: 90%;
        max-width: 280px;
        padding: 20px 12px;
    }
    
    .sidebar h3 {
        font-size: 0.7rem;
        margin: 16px 0 10px 6px;
    }
    
    .sidebar .tag-cloud {
        font-size: 0.8rem;
        padding: 10px 12px;
        border-radius: 8px;
    }
    
    .sidebar .tag-cloud span {
        font-size: 0.7rem;
        padding: 2px 6px;
        border-radius: 10px;
    }
    
    .contact-info {
        padding: 12px;
        font-size: 0.8rem;
    }
    
    /* Active filters section */
    .content > div[style*="background: #f0f0f0"] {
        padding: 12px !important;
        border-radius: 10px !important;
    }
    
    .content > div[style*="background: #f0f0f0"] strong {
        font-size: 13px;
        display: block;
        margin-bottom: 8px;
    }
}

/* Extra small devices (≤380px) */
@media (max-width: 380px) {
    .mobile-menu-btn {
        width: 38px;
        height: 38px;
    }
    
    .mobile-menu-btn span {
        width: 18px;
        height: 2px;
        margin: 4px auto;
    }
    
    #page-header #myInput {
        font-size: 13px;
        padding: 9px 12px;
    }
    
    #search-form button,
    #search-form a {
        font-size: 12px;
        padding: 9px 12px;
    }
    
    .view-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .sort-options select {
        font-size: 12px;
        padding: 7px 10px;
    }
    
    .wrapper {
        row-gap: 16px;
        column-gap: 10px;
    }
    
    .card {
        border-width: 3px;
    }
    
    .pagination-container a,
    .pagination-container span {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 11px;
    }
    
    .sidebar {
        max-width: 260px;
        padding: 16px 10px;
    }
    
    .sidebar .tag-cloud {
        font-size: 0.75rem;
        padding: 9px 10px;
    }
}

/* Landscape mode optimizations */
@media (max-width: 900px) and (orientation: landscape) {
    #page-header {
        padding: 60px 16px 12px 16px;
    }
    
    .mobile-menu-btn {
        width: 40px;
        height: 40px;
    }
    
    body:has(#page-header.header-fixed) .content {
        padding-top: 140px;
    }
    
    .wrapper {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .card {
        max-width: 100%;
    }
}

/* PWA / Standalone mode adjustments */
@media (display-mode: standalone) {
    #page-header {
        padding-top: calc(env(safe-area-inset-top) + 80px);
    }
    
    .mobile-menu-btn {
        top: calc(env(safe-area-inset-top) + 12px);
    }
    
    .sidebar {
        padding-top: calc(env(safe-area-inset-top) + 20px);
    }
}/* ==========================================================================
   MODERN E-PAPIER STYLES - ENHANCED VERSION
   ========================================================================== */

/* ==========================================================================
   1. TEMA RENK DEĞİŞKENLERİ VE GECE MODU
   ========================================================================== */

:root {
    color-scheme: light;
    
    /* Arka plan ve temel renkler */
    --body-bg-color: #f8f9fa;
    --body-bg-gradient: linear-gradient(180deg, #e9ecef 0%, #f8f9fa 20%, #dee2e6 100%);
    
    /* Metin renkleri */
    --text-color: #212529;
    --text-color-light: #6c757d;
    --text-color-muted: #adb5bd;
    
    /* Sidebar */
    --sidebar-bg: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    --sidebar-text: #ecf0f1;
    --sidebar-text-hover: #ffffff;
    --sidebar-tag-bg: rgba(255, 255, 255, 0.1);
    --sidebar-tag-hover-bg: rgba(255, 255, 255, 0.2);
    --sidebar-divider: rgba(255, 255, 255, 0.15);
    
    /* Kartlar */
    --card-bg: #ffffff;
    --card-border: #8b7355;
    --card-shadow: rgba(0, 0, 0, 0.08);
    --card-shadow-hover: rgba(0, 0, 0, 0.16);
    
    /* Input ve butonlar */
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --input-focus-border: #4dabf7;
    --input-text: #212529;
    
    --button-bg: #ffffff;
    --button-border: #dee2e6;
    --button-text: #495057;
    --button-hover-bg: #f8f9fa;
    --button-active-bg: #4dabf7;
    --button-active-text: #ffffff;
    
    /* Header */
    --header-bg: rgba(255, 255, 255, 0.95);
    --header-shadow: rgba(0, 0, 0, 0.08);
    --header-border: rgba(0, 0, 0, 0.05);
    
    /* Etiketler */
    --label-bg: rgba(0, 0, 0, 0.75);
    --label-text: #ffffff;
    --category-bg: #495057;
    --page-label-bg: #dc3545;
    --today-label-bg: #20c997;
    --free-label-bg: #fd7e14;
    
    /* Diğer */
    --divider-color: rgba(0, 0, 0, 0.1);
    --overlay-bg: rgba(255, 255, 255, 0.9);
}

html.dark-mode {
    color-scheme: dark;
    
    /* Arka plan ve temel renkler */
    --body-bg-color: #1a1d23;
    --body-bg-gradient: linear-gradient(180deg, #1a1d23 0%, #22272e 30%, #0d1117 100%);
    
    /* Metin renkleri */
    --text-color: #c9d1d9;
    --text-color-light: #8b949e;
    --text-color-muted: #6e7681;
    
    /* Sidebar */
    --sidebar-bg: linear-gradient(180deg, #161b22 0%, #0d1117 100%);
    --sidebar-text: #c9d1d9;
    --sidebar-text-hover: #ffffff;
    --sidebar-tag-bg: rgba(56, 139, 253, 0.15);
    --sidebar-tag-hover-bg: rgba(56, 139, 253, 0.25);
    --sidebar-divider: rgba(255, 255, 255, 0.1);
    
    /* Kartlar */
    --card-bg: #21262d;
    --card-border: #5a4f47;
    --card-shadow: rgba(0, 0, 0, 0.3);
    --card-shadow-hover: rgba(56, 139, 253, 0.2);
    
    /* Input ve butonlar */
    --input-bg: #0d1117;
    --input-border: #30363d;
    --input-focus-border: #388bfd;
    --input-text: #c9d1d9;
    
    --button-bg: #21262d;
    --button-border: #30363d;
    --button-text: #c9d1d9;
    --button-hover-bg: #30363d;
    --button-active-bg: #388bfd;
    --button-active-text: #ffffff;
    
    /* Header */
    --header-bg: rgba(22, 27, 34, 0.95);
    --header-shadow: rgba(0, 0, 0, 0.5);
    --header-border: rgba(255, 255, 255, 0.1);
    
    /* Etiketler */
    --label-bg: rgba(0, 0, 0, 0.5);
    --label-text: #ffffff;
    --category-bg: #30363d;
    --page-label-bg: #da3633;
    --today-label-bg: #238636;
    --free-label-bg: #d29922;
    
    /* Diğer */
    --divider-color: rgba(255, 255, 255, 0.1);
    --overlay-bg: rgba(13, 17, 23, 0.9);
}

/* Smooth transitions */
* {
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   2. ANA YAPI VE LAYOUT
   ========================================================================== */

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background-color: var(--body-bg-color);
    background-image: var(--body-bg-gradient);
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#page-header,
.content {
    margin-left: 18%;
    width: 82%;
    box-sizing: border-box;
}

/* ==========================================================================
   3. HEADER
   ========================================================================== */

#page-header {
    position: relative;
    z-index: 1025;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    gap: 24px;
    background-color: transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
    will-change: transform;
}

#page-header.header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 82%;
    margin-left: 18%;
    padding: 16px 32px;
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px var(--header-shadow);
    border-bottom: 1px solid var(--header-border);
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

body:has(#page-header.header-fixed) .content {
    padding-top: 100px;
}

/* Search Form */
#search-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    max-width: 700px;
}

#page-header #myInput {
    flex: 1;
    border: 2px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--input-text);
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#page-header #myInput:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 4px rgba(74, 171, 247, 0.1);
}

#page-header.header-fixed #myInput {
    padding: 10px 18px;
}

#search-form button,
#search-form a {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

#search-form button {
    background: linear-gradient(135deg, #4dabf7 0%, #339af0 100%);
    color: white;
}

#search-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 154, 240, 0.4);
}

#search-form button:active {
    transform: translateY(0);
}

#search-form a {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

#search-form a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(238, 90, 111, 0.4);
}

/* ==========================================================================
   4. SIDEBAR
   ========================================================================== */

.sidebar {
    width: 18%;
    background: var(--sidebar-bg);
    padding: 24px 16px;
    position: fixed;
    height: 100%;
    top: 0;
    left: 0;
    overflow-y: auto;
    box-sizing: border-box;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar h3 {
    color: var(--sidebar-text);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 20px 0 12px 8px;
    opacity: 0.9;
}

.sidebar .tag-cloud {
    display: block;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 12px 14px;
    border-radius: 10px;
    margin-top: 6px;
    text-align: left;
    cursor: pointer;
    background-color: var(--sidebar-tag-bg);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.sidebar .tag-cloud:hover {
    background-color: var(--sidebar-tag-hover-bg);
    color: var(--sidebar-text-hover);
    transform: translateX(4px);
}

.sidebar .tag-cloud.active {
    background-color: rgba(56, 139, 253, 0.25);
    box-shadow: inset 0 0 0 2px rgba(56, 139, 253, 0.5);
    color: var(--sidebar-text-hover);
    font-weight: 600;
}

.sidebar .tag-cloud span {
    float: right;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.divider {
    margin: 20px 0;
    border: none;
    border-top: 1px solid var(--sidebar-divider);
    opacity: 0.5;
}

.contact-info {
    text-align: center;
    margin-top: 24px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.contact-info a {
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.contact-info a:hover {
    color: var(--sidebar-text-hover);
}

/* ==========================================================================
   5. USER STATUS & THEME SWITCH
   ========================================================================== */

.theme-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
}

.theme-switch {
    display: inline-block;
    height: 32px;
    width: 56px;
    position: relative;
}

.theme-switch input {
    display: none;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background: linear-gradient(135deg, #4dabf7 0%, #339af0 100%);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.user-status-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.welcome-message {
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    font-size: 14px;
}

.auth-button {
    display: inline-block;
    padding: 10px 18px;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.auth-button:hover {
    transform: translateY(-2px);
}

.logout-button {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.logout-button:hover {
    box-shadow: 0 4px 12px rgba(238, 90, 111, 0.4);
}

.login-button {
    background: linear-gradient(135deg, #4dabf7 0%, #339af0 100%);
}

.login-button:hover {
    box-shadow: 0 4px 12px rgba(51, 154, 240, 0.4);
}

.register-button {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
}

.register-button:hover {
    box-shadow: 0 4px 12px rgba(55, 178, 77, 0.4);
}

.admin-button {
    background: linear-gradient(135deg, #868e96 0%, #495057 100%);
}

.admin-button:hover {
    box-shadow: 0 4px 12px rgba(73, 80, 87, 0.4);
}

.change-password-button {
    background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%);
}

.change-password-button:hover {
    box-shadow: 0 4px 12px rgba(250, 176, 5, 0.4);
}

/* ==========================================================================
   6. CONTENT AREA & CONTROLS
   ========================================================================== */

.content {
    padding: 32px;
    padding-bottom: 60px;
}

/* Active Filters Box */
.content > div[style*="background: #f0f0f0"] {
    background: var(--overlay-bg) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px !important;
    margin-bottom: 28px !important;
    border-radius: 12px !important;
    border: 1px solid var(--divider-color) !important;
    border-left: 4px solid #4dabf7 !important;
    box-shadow: 0 2px 8px var(--card-shadow);
}

.content > div[style*="background: #f0f0f0"] strong {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-color);
}

.content > div[style*="background: #f0f0f0"] span[style*="display: inline-block"] {
    padding: 8px 14px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* View Options */
.view-options,
.sort-options {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-options {
    justify-content: center;
}

.sort-options {
    justify-content: flex-end;
}

.view-options strong,
.sort-options strong {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color-light);
}

.view-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    background-color: var(--button-bg);
    color: var(--button-text);
    border: 2px solid var(--button-border);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-btn:hover {
    background-color: var(--button-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--card-shadow);
}

.view-btn.active {
    background: linear-gradient(135deg, #4dabf7 0%, #339af0 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(51, 154, 240, 0.3);
}

.sort-options select {
    padding: 10px 16px;
    border-radius: 10px;
    border: 2px solid var(--button-border);
    background-color: var(--button-bg);
    color: var(--button-text);
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sort-options select:hover {
    border-color: var(--input-focus-border);
}

.sort-options select:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 4px rgba(74, 171, 247, 0.1);
}

/* ==========================================================================
   7. MAGAZINE CARDS
   ========================================================================== */

.wrapper {
    margin: 40px auto;
    display: grid;
    width: 100%;
    justify-items: center;
    grid-auto-rows: minmax(240px, max-content);
    column-gap: 24px;
    row-gap: 40px;
}

.card {
    display: block;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 380px;
    aspect-ratio: 2 / 2.8;
    border: 5px solid var(--card-border);
    box-shadow: 0 4px 12px var(--card-shadow);
    background-color: var(--card-bg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border-radius: 8px;
    background-position: top;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 32px var(--card-shadow-hover);
    z-index: 10;
}

.card:hover::before {
    opacity: 1;
}

.card-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;  
    background-position: top;
    background-repeat: no-repeat;
    z-index: 0;
}

/* Labels */
.pagelabel,
.category,
.planlabel,
.new,
.free {
    position: absolute;
    z-index: 2;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.pagelabel {
    font-size: 0.7rem;
    line-height: 1;
    background-color: var(--page-label-bg);
    top: 0;
    right: 0;
    border-radius: 0 6px 0 8px;
    padding: 8px 10px;
    color: var(--label-text);
    box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.2);
}

.category {
    font-size: 0.7rem;
    line-height: 1;
    background-color: var(--category-bg);
    top: 0;
    left: 0;
    border-radius: 6px 0 8px 0;
    padding: 8px 10px;
    color: var(--label-text);
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
}

.planlabel {
    background-color: var(--card-bg);
    color: var(--text-color);
    bottom: 0;
    width: 100%;
    padding: 12px 10px;
    box-sizing: border-box;
    font-family: 'Merriweather', Georgia, serif;
    line-height: 1.4;
    font-size: 0.8rem;
    border-top: 2px solid var(--divider-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.new {
    background: linear-gradient(135deg, var(--today-label-bg) 0%, #12b886 100%);
    color: var(--label-text);
    top: 20px;
    right: -12px;
    padding: 6px 16px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transform: rotate(-8deg);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.free {
    background: linear-gradient(135deg, var(--free-label-bg) 0%, #e8590c 100%);
    color: var(--label-text);
    top: 20px;
    right: -12px;
    padding: 6px 16px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transform: rotate(-8deg);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Favorite Button */
.favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

html.dark-mode .favorite-btn {
    background: rgba(33, 38, 45, 0.95);
}

.favorite-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.favorite-btn svg {
    width: 22px;
    height: 22px;
    fill: #cbd5e0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.favorite-btn:hover svg {
    fill: #ff6b6b;
}

.favorite-btn.favorited svg {
    fill: #ff6b6b;
    stroke: #c92a2a;
    stroke-width: 1px;
    animation: heartBeat 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(0.95); }
}

/* ==========================================================================
   8. PAGINATION
   ========================================================================== */

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px 0;
    margin-top: 40px;
    gap: 8px;
    font-family: inherit;
}

.pagination-container a,
.pagination-container span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    border: 2px solid var(--button-border);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pagination-container a {
    background-color: var(--button-bg);
    color: var(--button-text);
}

.pagination-container a:hover {
    background-color: var(--button-hover-bg);
    border-color: var(--input-focus-border);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--card-shadow);
}

.pagination-container span.active {
    background: linear-gradient(135deg, #4dabf7 0%, #339af0 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(51, 154, 240, 0.3);
}

.pagination-container span.disabled {
    background-color: var(--button-bg);
    color: var(--text-color-muted);
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   9. LOADING STATE
   ========================================================================== */

#list.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

#list.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    border: 4px solid var(--input-border);
    border-top-color: var(--input-focus-border);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 100;
}

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

/* ==========================================================================
   10. RESPONSIVE DESIGN
   ========================================================================== */

/* Grid columns */
#list.cols-3 { grid-template-columns: repeat(3, 1fr); }
#list.cols-5 { grid-template-columns: repeat(5, 1fr); }

@media (min-width: 400px) {
    .wrapper:not(.cols-3):not(.cols-5) { grid-template-columns: repeat(1, 1fr); }
}

@media (min-width: 700px) {
    .wrapper:not(.cols-3):not(.cols-5) { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
    .wrapper:not(.cols-3):not(.cols-5) { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1400px) {
    .wrapper:not(.cols-3):not(.cols-5) { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1800px) {
    .wrapper:not(.cols-3):not(.cols-5) { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 2100px) {
    .wrapper:not(.cols-3):not(.cols-5) { grid-template-columns: repeat(7, 1fr); }
}

@media (min-width: 2700px) {
    .wrapper:not(.cols-3):not(.cols-5) { grid-template-columns: repeat(8, 1fr); }
}

@media (min-width: 3200px) {
    .wrapper:not(.cols-3):not(.cols-5) { grid-template-columns: repeat(9, 1fr); }
}

@media (min-width: 4000px) {
    .wrapper:not(.cols-3):not(.cols-5) { grid-template-columns: repeat(10, 1fr); }
}

/* ==========================================================================
   MOBILE HAMBURGER MENU
   ========================================================================== */

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 2000;
    background: var(--button-active-bg);
    border: none;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    margin: 5px auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1500;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-overlay.active {
    opacity: 1;
}

/* Mobile Layout (≤1200px) */
@media (max-width: 1200px) {
    /* Show hamburger menu */
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    /* Show overlay when needed */
    body.menu-open .mobile-overlay {
        display: block;
    }
    
    /* Full width layout */
    #page-header,
    #page-header.header-fixed,
    .content {
        margin-left: 0;
        width: 100%;
    }
    
    /* Transform sidebar to mobile menu */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 85%;
        max-width: 320px;
        height: 100%;
        z-index: 1600;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }
    
    body.menu-open .sidebar {
        left: 0;
    }
    
    /* Add close button to sidebar */
    .sidebar::before {
        content: '✕';
        position: absolute;
        top: 20px;
        right: 20px;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        color: var(--sidebar-text);
        font-size: 20px;
        cursor: pointer;
        transition: all 0.2s;
        z-index: 10;
    }
    
    .sidebar::before:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.1);
    }
    
    /* Adjust header for mobile - DAHA KOMPAKT */
    #page-header,
    #page-header.header-fixed {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 70px 16px 16px 16px; /* Daha az padding */
    }
    
    #page-header.header-fixed {
        padding: 70px 16px 14px 16px;
    }
    
    /* Search form - DAHA İYİ DÜZENLENMİŞ */
    #search-form {
        display: grid;
        grid-template-columns: 1fr auto auto; /* Input | Search | Clear */
        grid-template-rows: auto auto auto; /* 3 satır */
        gap: 10px;
        width: 100%;
    }
    
    /* Arama input - tam genişlik, ilk satır */
    #page-header #myInput {
        grid-column: 1 / -1; /* Tüm kolonları kapla */
        grid-row: 1;
        width: 100%;
        margin: 0;
        padding: 14px 16px; /* Daha büyük padding */
        font-size: 15px;
    }
    
    /* Search ve Clear butonları - yan yana, ikinci satır */
    #search-form button {
        grid-column: 1;
        grid-row: 2;
        padding: 14px 20px; /* Daha büyük butonlar */
        font-size: 15px;
        min-height: 48px; /* Dokunma için minimum yükseklik */
    }
    
    #search-form a {
        grid-column: 2 / -1;
        grid-row: 2;
        padding: 14px 20px;
        font-size: 15px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Theme switch ve User status - üçüncü satır, yan yana */
    .theme-switch-wrapper {
        grid-column: 1;
        grid-row: 3;
        order: unset;
        justify-content: flex-start;
    }
    
    #user-status-placeholder {
        grid-column: 2 / -1;
        grid-row: 3;
    }
    
    .user-status-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 8px;
        order: unset;
    }
    
    .welcome-message {
        white-space: normal;
        text-align: right;
        width: 100%;
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .auth-button {
        font-size: 14px;
        padding: 10px 16px; /* Daha büyük butonlar */
        min-height: 40px;
        white-space: nowrap;
    }
    
    /* Fixed header için daha az alan */
    body:has(#page-header.header-fixed) .content {
        padding-top: 160px; /* Azaltıldı */
    }
    
    /* Content padding */
    .content {
        padding: 20px 16px;
    }
    
    /* View/Sort options - daha büyük */
    .view-options,
    .sort-options {
        justify-content: center;
        flex-wrap: wrap;
        margin-bottom: 16px;
    }
    
    .view-options strong,
    .sort-options strong {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
        font-size: 15px;
    }
    
    .view-btn {
        padding: 12px 18px; /* Daha büyük */
        font-size: 14px;
        min-height: 44px;
    }
    
    .sort-options select {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    /* Adjust grid gaps */
    .wrapper {
        column-gap: 16px;
        row-gap: 32px;
        width: 95%;
    }
    
    /* Smaller cards */
    .card {
        max-width: 100%;
    }
    
    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }
    
    /* Filter badges - make them responsive */
    .content > div[style*="background: #f0f0f0"] {
        padding: 16px !important;
    }
    
    .content > div[style*="background: #f0f0f0"] span[style*="display: inline-block"] {
        margin: 4px !important;
        padding: 8px 12px !important;
        font-size: 13px !important;
    }
}

/* Tablet (≤900px) */
@media (max-width: 900px) {
    body {
        font-size: 15px;
    }
    
    #page-header {
        padding: 16px;
    }
    
    .content {
        padding: 16px 12px;
    }
    
    .view-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .wrapper {
        margin: 24px auto;
        row-gap: 24px;
    }
}

/* Mobile (≤600px) */
@media (max-width: 600px) {
    body {
        font-size: 14px;
    }
    
    #page-header #myInput {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    #search-form button,
    #search-form a {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .auth-button {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .view-btn {
        padding: 7px 12px;
        font-size: 12px;
    }
    
    .sort-options select {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .wrapper {
        margin: 20px auto;
        row-gap: 20px;
        width: 100%;
    }
    
    .card {
        border-width: 4px;
    }
    
    .pagelabel,
    .category {
        font-size: 0.65rem;
        padding: 6px 8px;
    }
    
    .new,
    .free {
        font-size: 0.7rem;
        padding: 5px 12px;
        top: 16px;
        right: -10px;
    }
    
    .planlabel {
        font-size: 0.75rem;
        padding: 10px 8px;
    }
    
    .favorite-btn {
        width: 38px;
        height: 38px;
        top: 6px;
        right: 6px;
    }
    
    .favorite-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .pagination-container {
        gap: 6px;
        padding: 24px 0;
    }
    
    .pagination-container a,
    .pagination-container span {
        min-width: 38px;
        height: 38px;
        padding: 0 12px;
        font-size: 13px;
    }
    
    body:has(#page-header.header-fixed) .content {
        padding-top: 320px;
    }
}

/* ==========================================================================
   11. PRINT STYLES
   ========================================================================== */

@media print {
    .sidebar,
    #page-header,
    .view-options,
    .sort-options,
    .pagination-container,
    .favorite-btn,
    .theme-switch-wrapper {
        display: none !important;
    }
    
    .content {
        margin: 0;
        width: 100%;
        padding: 0;
    }
    
    .wrapper {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    body {
        background: white;
    }
}

/* ==========================================================================
   12. ACCESSIBILITY IMPROVEMENTS
   ========================================================================== */

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--input-focus-border);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border-width: 3px;
    }
    
    .view-btn,
    .auth-button,
    #search-form button {
        border-width: 3px;
    }
}

/* ==========================================================================
   13. UTILITY CLASSES
   ========================================================================== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.no-scroll {
    overflow: hidden;
}

/* ==========================================================================
   14. ANIMATIONS
   ========================================================================== */

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

.card {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.4s; }
.card:nth-child(9) { animation-delay: 0.45s; }
.card:nth-child(10) { animation-delay: 0.5s; }

.download-app-container {
    position: fixed;
    top: 140px;
    z-index: 9999;
}

.download-app-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
}

.download-app-btn::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;
}

.download-app-btn:hover::before {
    width: 300px;
    height: 300px;
}

.download-app-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.6);
}

.download-app-btn:active {
    transform: scale(0.95);
}

.download-icon {
    font-size: 32px;
    position: relative;
    z-index: 1;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.download-tooltip {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.download-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 25px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(0, 0, 0, 0.9);
}

.download-app-btn:hover + .download-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive styles */
@media (max-width: 768px) {
    .download-app-container {
        bottom: 20px;
        right: 20px;
    }

    .download-app-btn {
        width: 60px;
        height: 60px;
    }

    .download-icon {
        font-size: 28px;
    }

    .download-tooltip {
        font-size: 12px;
        padding: 10px 16px;
        bottom: 70px;
    }
}

/* Pulse animation for attention */
@keyframes pulse {
    0% {
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.7);
    }
    100% {
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    }
}

.download-app-btn.pulse {
    animation: pulse 2s infinite;
}

