/* Profesyonel Akıllı Tahta Eğitim Sistemi - Modern Tasarım */

/* Local Fonts */
@import url('../assets/fonts/google-fonts-local.css');

/* SAYFA ATLAMA STİLLERİ - PROFESYONELLEŞTİRİLMİŞ */
.page-info {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Inter', sans-serif;
    color: var(--dark-gray);
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--bg-tertiary);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.page-info:hover {
    border-color: rgba(74, 144, 226, 0.3);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
}

#current-page-input {
    width: 32px;
    padding: 2px 4px;
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    color: #333;
    outline: none;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    line-height: 1.2;
    margin: 0 1px;
}

#current-page-input:hover {
    border-color: rgba(74, 144, 226, 0.4);
    background: white;
}

#current-page-input:focus {
    border-color: #4A90E2;
    background: white;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

#current-page-input::-webkit-outer-spin-button,
#current-page-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#current-page-input[type=number] {
    -moz-appearance: textfield;
}

.page-jump-btn {
    background: rgba(74, 144, 226, 0.1);
    color: #4A90E2;
    border: 1px solid rgba(74, 144, 226, 0.2);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 9px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-left: 2px;
}

.page-jump-btn:hover {
    background: rgba(74, 144, 226, 0.15);
    border-color: rgba(74, 144, 226, 0.3);
    color: #2563eb;
}

.page-jump-btn:active {
    background: rgba(74, 144, 226, 0.2);
    transform: scale(0.95);
}

.page-jump-btn i {
    font-size: 7px;
    line-height: 1;
}

/* Responsive tasarım - Mobile */
@media (max-width: 768px) {
    .page-info {
        padding: 5px 10px;
        font-size: 13px;
        gap: 3px;
    }
    
    #current-page-input {
        width: 28px;
        padding: 2px 3px;
        font-size: 12px;
    }
    
    .page-jump-btn {
        padding: 2px 3px;
        min-width: 16px;
        height: 16px;
        font-size: 8px;
    }
    
    .page-jump-btn i {
        font-size: 6px;
    }
}

/* Ekstra küçük ekranlar */
@media (max-width: 480px) {
    .page-info {
        padding: 4px 8px;
        font-size: 12px;
        gap: 2px;
    }
    
    #current-page-input {
        width: 26px;
        padding: 1px 2px;
        font-size: 11px;
    }
    
    .page-jump-btn {
        padding: 1px 2px;
        min-width: 14px;
        height: 14px;
    }
    
    .page-jump-btn i {
        font-size: 5px;
    }
}

/* CSS DEĞİŞKENLERİ - PROFESYONEL RENKLER */
:root {
    /* Ana Renkler - Modern ve Profesyonel */
    --primary-blue: #2563eb;
    --primary-dark: #1e40af;
    --secondary-gray: #64748b;
    --light-gray: #f1f5f9;
    --dark-gray: #334155;
    --success-green: #059669;
    --warning-orange: #d97706;
    --error-red: #dc2626;
    --accent-purple: #7c3aed;
    
    /* Nötr Arka Planlar */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    --bg-overlay: rgba(255, 255, 255, 0.95);
    
    /* Minimal Gradientler */
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    --gradient-secondary: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --gradient-bg: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    
    /* Gölgeler ve Efektler */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    
    /* Toolbox Boyutları */
    --toolbox-width: 300px;
    --toolbox-button-size: 44px;
}

/* GENEL AYARLAR */
* {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: 
        /* Modern profesyonel gradient - premium look */
        linear-gradient(135deg, 
            rgba(248, 250, 252, 0.98) 0%, 
            rgba(241, 245, 249, 0.95) 25%, 
            rgba(226, 232, 240, 0.92) 50%, 
            rgba(203, 213, 225, 0.95) 75%, 
            rgba(241, 245, 249, 0.98) 100%),
        /* Premium overlay texture */
        radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.02) 0%, transparent 50%);
    background-attachment: fixed;
    height: 100vh;
    overflow: hidden;
    touch-action: manipulation;
    color: var(--dark-gray);
    line-height: 1.5;
    position: relative;
}

/* Eğlenceli çocuk sembolleri overlay */
body::before {
    content: '⭐      🌟      ✨      💖      🌸      🦋      ☁️      🌞      ⭐      🌟      ✨      💖      🌸      🦋      ☁️      🌞';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-size: 14px;
    letter-spacing: 150px;
    line-height: 200px;
    word-spacing: 100px;
    color: rgba(255, 182, 193, 0.08);
    overflow: hidden;
    white-space: pre-wrap;
    animation: emojiFloat 400s linear infinite;
    pointer-events: none;
    z-index: -1;
    opacity: 0.3;
}

/* İkinci sevimli layer */
body::after {
    content: '   🌈   🎈   🌺   🌼   🍭   🎀   🌷   🦋   🌈   🎈   🌺   🌼   🍭   🎀   🌷   🦋';
    position: fixed;
    top: 100px;
    left: 75px;
    width: 100%;
    height: 100%;
    font-size: 12px;
    letter-spacing: 180px;
    line-height: 250px;
    word-spacing: 120px;
    color: rgba(255, 215, 0, 0.06);
    overflow: hidden;
    white-space: pre-wrap;
    animation: emojiFloat 500s linear infinite reverse;
    pointer-events: none;
    z-index: -2;
    opacity: 0.25;
}

/* Emoji float animasyonları */
@keyframes emojiFloat {
    0% { 
        transform: translateX(-50px) translateY(0px) rotate(0deg);
        opacity: 0.6;
        filter: hue-rotate(0deg) brightness(1);
    }
    25% { 
        transform: translateX(25px) translateY(-20px) rotate(5deg);
        opacity: 0.8;
        filter: hue-rotate(10deg) brightness(1.1);
    }
    50% { 
        transform: translateX(50px) translateY(-10px) rotate(-3deg);
        opacity: 1;
        filter: hue-rotate(20deg) brightness(1.2);
    }
    75% { 
        transform: translateX(25px) translateY(-30px) rotate(7deg);
        opacity: 0.7;
        filter: hue-rotate(15deg) brightness(1.05);
    }
    100% { 
        transform: translateX(-50px) translateY(0px) rotate(0deg);
        opacity: 0.6;
        filter: hue-rotate(0deg) brightness(1);
    }
}

@keyframes premiumPulse {
    0%, 100% { 
        opacity: 0.4; 
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.02) rotate(0.5deg);
        filter: brightness(1.05);
    }
}

/* Kaldırılan animasyon elementi */

/* ANA KONTEYNİR */
.maindiv {
    display: flex;
    flex-direction: column;
    padding: 16px;
    margin: 0;
    height: 100vh;
    gap: 16px;
}

/* ANA İÇERİK ALANI */
.main-content {
    flex: 1;
    min-height: 0;
    position: relative;
}

/* SAYFA GÖRÜNTÜLEME - Eğlenceli Çocuk Dostu */
.page-display {
    width: 100%;
    height: 100%;
    background: 
        /* Sevimli gökkuşağı çizgileri */
        linear-gradient(45deg, rgba(255, 99, 132, 0.05) 2px, transparent 4px),
        linear-gradient(-45deg, rgba(54, 162, 235, 0.04) 2px, transparent 4px),
        /* Minik baloncuklar */
        radial-gradient(circle 4px at 20% 30%, rgba(173, 216, 230, 0.15) 50%, transparent 70%),
        radial-gradient(circle 3px at 80% 20%, rgba(173, 216, 230, 0.12) 50%, transparent 70%),
        radial-gradient(circle 5px at 40% 80%, rgba(173, 216, 230, 0.1) 50%, transparent 70%),
        radial-gradient(circle 2px at 70% 60%, rgba(173, 216, 230, 0.08) 50%, transparent 70%),
        /* Büyülü yıldız tozu */
        radial-gradient(circle 2px at 30% 50%, rgba(255, 215, 0, 0.2) 60%, transparent 80%),
        radial-gradient(circle 1.5px at 60% 25%, rgba(255, 215, 0, 0.18) 60%, transparent 80%),
        radial-gradient(circle 2.5px at 85% 75%, rgba(255, 215, 0, 0.15) 60%, transparent 80%),
        /* Şirin kelebekler */
        radial-gradient(ellipse 8px 4px at 25% 70%, rgba(255, 182, 193, 0.12) 40%, transparent 70%),
        radial-gradient(ellipse 6px 3px at 75% 35%, rgba(255, 182, 193, 0.1) 40%, transparent 70%),
        /* Yumuşak çiçek petalleri */
        radial-gradient(circle 6px at 50% 15%, rgba(255, 192, 203, 0.08) 30%, transparent 60%),
        radial-gradient(circle 4px at 15% 85%, rgba(255, 192, 203, 0.06) 30%, transparent 60%),
        /* Ana eğlenceli gradient */
        linear-gradient(135deg, 
            rgba(248, 250, 252, 0.95) 0%, 
            rgba(240, 249, 255, 0.9) 25%, 
            rgba(236, 254, 255, 0.85) 50%, 
            rgba(240, 249, 255, 0.9) 75%, 
            rgba(248, 250, 252, 0.95) 100%);
    background-size: 
        80px 80px,
        70px 70px,
        200px 200px,
        180px 180px,
        220px 220px,
        160px 160px,
        150px 150px,
        130px 130px,
        170px 170px,
        250px 200px,
        230px 180px,
        300px 250px,
        280px 230px,
        100% 100%;
    animation: playfulMotion 180s ease-in-out infinite;
    backdrop-filter: blur(8px) saturate(180%);
    border-radius: var(--border-radius-lg);
    box-shadow: 
        0 8px 32px rgba(173, 216, 230, 0.1),
        0 2px 16px rgba(255, 182, 193, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.02);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

@keyframes playfulMotion {
    0%, 100% { 
        background-position: 0 0, 0 0, 20% 30%, 80% 20%, 40% 80%, 70% 60%, 30% 50%, 60% 25%, 85% 75%, 25% 70%, 75% 35%, 50% 15%, 15% 85%, 0 0;
        filter: hue-rotate(0deg) brightness(1) saturate(100%);
        opacity: 0.8;
    }
    25% { 
        background-position: 15px 10px, -10px 15px, 25% 35%, 75% 25%, 45% 75%, 65% 65%, 35% 45%, 65% 30%, 80% 80%, 30% 65%, 70% 40%, 55% 10%, 20% 80%, 0 0;
        filter: hue-rotate(5deg) brightness(1.05) saturate(110%);
        opacity: 0.9;
    }
    50% { 
        background-position: 25px 25px, -15px 30px, 30% 40%, 70% 30%, 50% 70%, 60% 70%, 40% 40%, 70% 35%, 75% 85%, 35% 60%, 65% 45%, 60% 5%, 25% 75%, 0 0;
        filter: hue-rotate(10deg) brightness(1.1) saturate(120%);
        opacity: 1;
    }
    75% { 
        background-position: 10px 40px, -5px 45px, 35% 25%, 65% 35%, 55% 85%, 55% 55%, 45% 55%, 75% 20%, 70% 90%, 40% 75%, 60% 30%, 65% 20%, 30% 70%, 0 0;
        filter: hue-rotate(7deg) brightness(1.02) saturate(105%);
        opacity: 0.85;
    }
}

/* Kaldırılan accent elementler */

/* SAYFA TASARIMI */
.page {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    gap: 20px;
    min-height: 500px;
}

/* SAYFA GÖRSELLER KONTEYNİRİ */
.page-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    gap: 12px;
    flex: 1;
    position: relative;
    max-width: 85%;
    max-height: 90%;
}

.page-container.double-page-mode {
    gap: 2px;
    padding: 20px;
    background: 
        /* Sevimli çifte gökkuşağı */
        linear-gradient(30deg, rgba(255, 99, 132, 0.03) 1px, transparent 3px),
        linear-gradient(150deg, rgba(54, 162, 235, 0.025) 1px, transparent 3px),
        /* Simetrik kelebek kanatları */
        radial-gradient(ellipse 12px 8px at 30% 40%, rgba(255, 182, 193, 0.08) 40%, transparent 70%),
        radial-gradient(ellipse 10px 6px at 70% 40%, rgba(255, 182, 193, 0.06) 40%, transparent 70%),
        /* Mini yıldız konstellasyonu */
        radial-gradient(circle 2px at 25% 25%, rgba(255, 215, 0, 0.15) 50%, transparent 80%),
        radial-gradient(circle 1.5px at 75% 75%, rgba(255, 215, 0, 0.12) 50%, transparent 80%),
        radial-gradient(circle 1px at 50% 60%, rgba(255, 215, 0, 0.1) 50%, transparent 80%),
        /* Şirin çiçek bahçesi */
        radial-gradient(circle 3px at 20% 70%, rgba(255, 192, 203, 0.06) 30%, transparent 60%),
        radial-gradient(circle 2px at 80% 30%, rgba(255, 192, 203, 0.05) 30%, transparent 60%),
        /* Uçan kalpler */
        radial-gradient(circle 2px at 40% 20%, rgba(255, 182, 193, 0.08) 40%, transparent 70%),
        radial-gradient(circle 1.5px at 60% 80%, rgba(255, 182, 193, 0.06) 40%, transparent 70%),
        /* Büyülü bulut parçacıkları */
        radial-gradient(ellipse 8px 4px at 35% 60%, rgba(173, 216, 230, 0.05) 30%, transparent 60%),
        radial-gradient(ellipse 6px 3px at 65% 15%, rgba(173, 216, 230, 0.04) 30%, transparent 60%),
        /* Çocuk dostu gradient */
        linear-gradient(135deg, 
            rgba(248, 250, 252, 0.85) 0%, 
            rgba(240, 249, 255, 0.8) 25%, 
            rgba(236, 254, 255, 0.75) 50%, 
            rgba(240, 249, 255, 0.8) 75%, 
            rgba(248, 250, 252, 0.85) 100%);
    background-size: 
        60px 60px,
        50px 50px,
        100px 80px,
        90px 70px,
        80px 80px,
        85px 85px,
        75px 75px,
        120px 100px,
        110px 90px,
        90px 90px,
        95px 95px,
        130px 110px,
        120px 100px,
        100% 100%;
    border-radius: var(--border-radius-lg);
    box-shadow: 
        0 8px 32px rgba(173, 216, 230, 0.08),
        0 4px 16px rgba(255, 182, 193, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px) saturate(150%);
}

.page-container.double-page-mode::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 20%;
    bottom: 20%;
    width: 2px;
    background: var(--bg-tertiary);
    transform: translateX(-50%);
    z-index: 1;
    border-radius: 1px;
}

/* SAYFA CANVAS KONTEYNİRİ */
.page-canvas-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    max-width: 45%;
    /* max-height sınırı kaldırıldı - tam sayfa çizimi için */
}

#sayfa, #sayfa2 {
    background-image: url("images/Loading.gif");
    background-color: rgba(248, 250, 252, 0.95);
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 
        0 12px 40px rgba(59, 130, 246, 0.08),
        0 4px 16px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(0, 0, 0, 0.02);
    border-radius: var(--border-radius);
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: crosshair;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px) saturate(180%);
    /* Professional glass morphism effect */
    background-blend-mode: normal;
}

/* ÇİZİM CANVAS'I */
.drawing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    border-radius: var(--border-radius);
    cursor: crosshair;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.drawing-canvas.active {
    pointer-events: auto;
}

/* TEK SAYFA MODU */
.page-container:not(.double-page-mode) .page-canvas-container {
    max-width: 45%;
    /* max-height sınırı kaldırıldı - tam sayfa çizimi için */
}

/* ÇİFT SAYFA MODU */
.page-container.double-page-mode .page-canvas-container {
    max-width: 40%;
    flex: 1;
}

.page-container.double-page-mode #sayfa,
.page-container.double-page-mode #sayfa2 {
    border-radius: var(--border-radius);
    box-shadow: 
        0 8px 30px rgba(59, 130, 246, 0.06),
        0 2px 12px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(12px) saturate(170%);
}

.page-container.double-page-mode #sayfa {
    margin-right: -1px;
    border-top-right-radius: 2px;
    border-bottom-right-radius: 2px;
    border-right: none;
    z-index: 1;
}

.page-container.double-page-mode #sayfa2 {
    margin-left: -1px;
    border-top-left-radius: 2px;
    border-bottom-left-radius: 2px;
    border-left: none;
    z-index: 1;
}

.page-container.double-page-mode #sayfa:hover {
    transform: scale(1.02) translateY(-2px);
    box-shadow: 
        0 16px 50px rgba(59, 130, 246, 0.12),
        0 8px 25px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    z-index: 10;
    border-right: 1px solid rgba(255, 255, 255, 0.4);
    border-top-right-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
    backdrop-filter: blur(15px) saturate(200%);
}

.page-container.double-page-mode #sayfa2:hover {
    transform: scale(1.02) translateY(-2px);
    box-shadow: 
        0 16px 50px rgba(59, 130, 246, 0.12),
        0 8px 25px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    z-index: 10;
    border-left: 1px solid rgba(255, 255, 255, 0.4);
    border-top-left-radius: var(--border-radius);
    border-bottom-left-radius: var(--border-radius);
    backdrop-filter: blur(15px) saturate(200%);
}

.page-container:not(.double-page-mode) #sayfa:hover {
    transform: scale(1.02) translateY(-3px);
    box-shadow: 
        0 20px 60px rgba(59, 130, 246, 0.15),
        0 8px 30px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: rgba(59, 130, 246, 0.3);
    backdrop-filter: blur(15px) saturate(200%);
}

#sayfa2 {
    border-color: var(--secondary-gray);
}

.page-container:not(.double-page-mode) #sayfa2:hover {
    border-color: var(--accent-purple);
}

/* SAYFA NAVİGASYON VE KONTROLLER - YENİ DÜZEN */
.page-controls {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 150 !important;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    position: fixed !important;
    bottom: 2px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    pointer-events: auto !important;
}

.page-navigation {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 95 !important;
    gap: 16px;
    align-items: center;
    padding: 12px 24px;
    background: 
        /* Professional grid pattern */
        linear-gradient(90deg, rgba(59, 130, 246, 0.008) 1px, transparent 1px),
        linear-gradient(0deg, rgba(99, 102, 241, 0.006) 1px, transparent 1px),
        /* Premium glass background */
        linear-gradient(135deg, 
            rgba(255, 255, 255, 0.25) 0%, 
            rgba(255, 255, 255, 0.1) 50%, 
            rgba(255, 255, 255, 0.05) 100%);
    background-size: 30px 30px, 30px 30px, 100% 100%;
    border-radius: calc(var(--border-radius) + 2px);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 2px 16px rgba(59, 130, 246, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    backdrop-filter: blur(20px) saturate(180%);
}

.page-navigation a {
    background: 
        linear-gradient(135deg, 
            rgba(59, 130, 246, 0.9) 0%, 
            rgba(37, 99, 235, 0.95) 100%);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 
        0 4px 16px rgba(59, 130, 246, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    width: 44px;
    height: 44px;
    backdrop-filter: blur(8px);
}

.page-navigation a:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(59, 130, 246, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: 
        linear-gradient(135deg, 
            rgba(37, 99, 235, 0.95) 0%, 
            rgba(29, 78, 216, 1) 100%);
    border-color: rgba(255, 255, 255, 0.2);
}

.page-navigation a i {
    font-size: 16px;
}

.page-navigation span {
    font-family: 'Inter', sans-serif;
    color: var(--dark-gray);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--bg-tertiary);
    box-shadow: var(--shadow-sm);
}

/* KONTROL BUTONLARI - YENİ DÜZEN VE TASARIM */
.control-buttons {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1002 !important;
    gap: 10px;
    flex-direction: column;
    align-items: stretch;
    position: fixed !important;
    top: 620px !important;
    left: 20px !important;
    margin: 0 !important;
    padding: 15px;
    width: 200px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
    transform: none !important;
    pointer-events: auto !important;
    transition: all 0.2s ease;
}

.control-buttons:hover {
    box-shadow: 
        0 6px 25px rgba(0, 0, 0, 0.12),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

/* BACK TO MAIN CONTAINER - CONTROL BUTTONS İÇİNE ENTEGRE */
.back-to-main-container {
    display: none !important;
}

/* Butonların görünürlüğünü garanti et */
.control-buttons .page-selector-btn,
.control-buttons .double-page-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    pointer-events: auto !important;
    z-index: 1003 !important;
}

.page-selector-btn,
.double-page-btn,
.back-to-main-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 12px 15px;
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
}

.page-selector-btn i,
.double-page-btn i,
.back-to-main-btn i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.page-selector-btn:hover,
.double-page-btn:hover {
    background: #e0e7ff;
    border-color: #c7d2fe;
    color: #3730a3;
    transform: translateY(-1px);
}

.page-selector-btn:hover i,
.double-page-btn:hover i {
    color: #4338ca;
}

/* Ana menü butonu - inline olarak control-buttons içinde */
.back-to-main-btn {
    background: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #dc2626 !important;
    margin-top: 8px;
    position: relative;
}

.back-to-main-btn::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.back-to-main-btn:hover {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    color: white !important;
    transform: translateY(-1px);
}

.back-to-main-btn:hover i {
    color: white !important;
}

.page-selector-btn:active,
.double-page-btn:active,
.back-to-main-btn:active {
    transform: translateY(0);
}

/* Responsive tasarım */
@media (max-width: 768px) {
    .control-buttons {
        top: 480px !important;
        left: 10px !important;
        width: 180px;
        padding: 12px;
        gap: 8px;
    }
    
    .page-selector-btn,
    .double-page-btn,
    .back-to-main-btn {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .page-selector-btn i,
    .double-page-btn i,
    .back-to-main-btn i {
        font-size: 14px;
        width: 18px;
    }
}

/* TAŞINABİLİR TOOLBOX - ANA EĞİTİM ARAÇLARI */
.floating-toolbox {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 320px;
    max-height: 65vh;
    background: var(--bg-overlay);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(37, 99, 235, 0.15);
    z-index: 1000;
    transition: var(--transition);
    overflow: hidden;
    resize: both;
    min-width: 280px;
    min-height: 200px;
}

/* ÇİZİM TOOLBOX'I - TAŞINABİLİR */
.drawing-toolbox {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 280px;
    max-height: 50vh;
    background: var(--bg-overlay);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(124, 58, 237, 0.15);
    z-index: 1001;
    transition: var(--transition);
    overflow: hidden;
    resize: both;
    min-width: 250px;
    min-height: 150px;
}

.drawing-toolbox.hidden {
    transform: translate(-100%, 0);
    opacity: 0;
    pointer-events: none;
}

/* TOOLBOX HOVER EFEKTLERİ */
.floating-toolbox:hover,
.drawing-toolbox:hover {
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.25);
}

.drawing-toolbox:hover {
    border-color: rgba(124, 58, 237, 0.25);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(124, 58, 237, 0.1);
}

/* TOOLBOX BAŞLIKLARI - MODERN TASARIM */
.toolbox-header,
.drawing-toolbox-header {
    background: var(--gradient-primary);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

/* DRAG INDICATOR */
.toolbox-header::before,
.drawing-toolbox-header::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 4px;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.toolbox-header:active,
.drawing-toolbox-header:active {
    cursor: grabbing;
    background: var(--primary-dark);
}

.toolbox-title,
.drawing-toolbox-title {
    color: white;
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toolbox-title i,
.drawing-toolbox-title i {
    font-size: 14px;
    opacity: 0.9;
}

.toolbox-actions,
.drawing-toolbox-actions {
    display: flex;
    gap: 6px;
}

.toolbox-toggle,
.toolbox-minimize,
.drawing-toolbox-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.toolbox-toggle:hover,
.toolbox-minimize:hover,
.drawing-toolbox-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* TOOLBOX İÇERİK - MODERN GRİD SİSTEMİ */
.toolbox-content,
.drawing-toolbox-content {
    padding: 18px;
    max-height: calc(65vh - 80px);
    overflow-y: auto;
    background: var(--bg-primary);
}

.toolbox-content::-webkit-scrollbar,
.drawing-toolbox-content::-webkit-scrollbar {
    width: 4px;
}

.toolbox-content::-webkit-scrollbar-track,
.drawing-toolbox-content::-webkit-scrollbar-track {
    background: transparent;
}

.toolbox-content::-webkit-scrollbar-thumb,
.drawing-toolbox-content::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
    border-radius: 2px;
}

.toolbox-content::-webkit-scrollbar-thumb:hover,
.drawing-toolbox-content::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.5);
}

/* ARAÇ GRUPLARI - KART SİSTEMİ */
.tool-group,
.drawing-tool-group {
    margin-bottom: 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 14px;
    border: 1px solid var(--bg-tertiary);
    transition: var(--transition);
}

.tool-group:last-child,
.drawing-tool-group:last-child {
    margin-bottom: 0;
}

.tool-group:hover,
.drawing-tool-group:hover {
    background: rgba(37, 99, 235, 0.02);
    border-color: rgba(37, 99, 235, 0.15);
}

.drawing-tool-group:hover {
    background: rgba(124, 58, 237, 0.02);
    border-color: rgba(124, 58, 237, 0.15);
}

.tool-group h4,
.drawing-tool-group h4 {
    margin: 0 0 12px 0;
    color: var(--dark-gray);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--bg-tertiary);
}

.tool-group h4 i,
.drawing-tool-group h4 i {
    font-size: 12px;
    color: var(--primary-blue);
}

.drawing-tool-group h4 i {
    color: var(--accent-purple);
}

/* ARAÇ BUTONLARI - MODERNİZE EDİLMİŞ GRİD */
.tool-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.drawing-tool-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

/* ANA TOOLBOX BUTONLARI */
button[id*="videosol"],
button[id*="musicsol"],
button[id*="yonergesol"],
button[id*="sescalsol"] {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 6px;
    background: white;
    border: 1px solid var(--bg-tertiary);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--dark-gray);
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    min-height: 50px;
    position: relative;
    overflow: hidden;
}

/* BUTON KATEGORİ RENKLERİ */
button[id*="videosol"] {
    border-left: 3px solid #ef4444;
}

button[id*="musicsol"] {
    border-left: 3px solid #06b6d4;
}

button[id*="yonergesol"] {
    border-left: 3px solid #10b981;
}

button[id*="sescalsol"] {
    border-left: 3px solid #8b5cf6;
}

button[id*="videosol"]:hover,
button[id*="musicsol"]:hover,
button[id*="yonergesol"]:hover,
button[id*="sescalsol"]:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* HOVER'DA KATEGOR RENKLERİNİ KORU */
button[id*="videosol"]:hover {
    background: #ef4444;
    border-color: #ef4444;
}

button[id*="musicsol"]:hover {
    background: #06b6d4;
    border-color: #06b6d4;
}

button[id*="yonergesol"]:hover {
    background: #10b981;
    border-color: #10b981;
}

button[id*="sescalsol"]:hover {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

button[id*="videosol"] i,
button[id*="musicsol"] i,
button[id*="yonergesol"] i,
button[id*="sescalsol"] i {
    font-size: 14px;
    margin-bottom: 2px;
}

/* AKTİF DURUM */
button[id*="videosol"]:active,
button[id*="musicsol"]:active,
button[id*="yonergesol"]:active,
button[id*="sescalsol"]:active {
    transform: scale(0.95);
}

/* ÇİZİM ARAÇLARI - MODERN TASARIM */
.drawing-tool-btn {
    width: 36px;
    height: 36px;
    background: white;
    border: 1px solid var(--bg-tertiary);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--dark-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.drawing-tool-btn:hover {
    background: var(--accent-purple);
    color: white;
    border-color: var(--accent-purple);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.drawing-tool-btn.active {
    background: var(--accent-purple);
    color: white;
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-lg);
}

.drawing-tool-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--warning-orange);
}

/* RENK PALETİ - COMPACT DESIGN */
.color-palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 4px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--bg-tertiary);
}

.color-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
}

.color-btn:hover {
    transform: scale(1.15);
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: var(--shadow-md), inset 0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.color-btn.active {
    transform: scale(1.2) !important;
    border-color: var(--dark-gray) !important;
    box-shadow: var(--shadow-lg), inset 0 1px 2px rgba(0, 0, 0, 0.1) !important;
    z-index: 10 !important;
}

/* Eski ::after kuralı devre dışı - fa-check kullanıyoruz */
.color-btn.active::after {
    content: none !important;
    display: none !important;
}

/* Aktif olmayan renk butonları için güçlü kurallar */
.color-btn:not(.active) {
    transform: scale(1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    z-index: 1 !important;
}

/* ÇİZİM KONTROL BUTONLARI - COMPACT */
.drawing-control-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.drawing-control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    border: 1px solid transparent;
}

.clear-btn {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: var(--error-red);
    border-color: #fca5a5;
}

.undo-btn {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: var(--warning-orange);
    border-color: #facc15;
}

.save-btn {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: var(--success-green);
    border-color: #6ee7b7;
}

.drawing-control-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.clear-btn:hover {
    background: var(--error-red);
    color: white;
}

.undo-btn:hover {
    background: var(--warning-orange);
    color: white;
}

.save-btn:hover {
    background: var(--success-green);
    color: white;
}

/* FLOATING STATES - İYİLEŞTİRİLMİŞ */
.floating-toolbox.dragging,
.drawing-toolbox.dragging {
    transform: rotate(3deg) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    border-color: var(--primary-blue);
    z-index: 9999 !important;
}

.drawing-toolbox.dragging {
    border-color: var(--accent-purple);
}

.floating-toolbox.minimized,
.drawing-toolbox.minimized {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
}

.floating-toolbox.minimized .toolbox-content,
.drawing-toolbox.minimized .drawing-toolbox-content {
    display: none;
}

.floating-toolbox.minimized .toolbox-title,
.drawing-toolbox.minimized .drawing-toolbox-title {
    display: none;
}

.floating-toolbox.minimized .toolbox-actions,
.drawing-toolbox.minimized .drawing-toolbox-actions {
    flex-direction: column;
    gap: 2px;
}

.floating-toolbox.minimized .toolbox-header,
.drawing-toolbox.minimized .drawing-toolbox-header {
    padding: 8px;
    justify-content: center;
}

.floating-toolbox.minimized .toolbox-header::before,
.drawing-toolbox.minimized .drawing-toolbox-header::before {
    display: none;
}

/* KÜÇÜK RESİMLER PANELİ - GENİŞLETİLMİŞ */
.thumbnails {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 280px;
    background: 
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(25px);
    border-top: 2px solid rgba(37, 99, 235, 0.1);
    box-shadow: 
        0 -8px 32px rgba(0, 0, 0, 0.1),
        0 -4px 16px rgba(0, 0, 0, 0.05);
    z-index: 100;
    padding: 20px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateY(0);
}

.thumbnails.hidden {
    transform: translateY(100%);
}

#Panel {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 0 16px;
}

#Panel a,
#Panel button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

#Panel a:hover,
#Panel button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
    background: var(--primary-dark);
}

/* Kapat butonu özel stili */
.close-thumbnails-btn {
    background: linear-gradient(135deg, var(--error-red), #dc2626) !important;
    margin-left: 12px;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2) !important;
}

.close-thumbnails-btn:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b) !important;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3) !important;
}

.close-thumbnails-btn:active {
    transform: translateY(-1px) scale(1.02);
}

#Thumbs {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 24px 28px;
    background: 
        linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%);
    border-radius: 20px;
    border: 2px solid rgba(37, 99, 235, 0.1);
    max-height: 180px;
    scroll-behavior: smooth;
    cursor: grab;
    user-select: none;
    position: relative;
    /* Mobile scroll optimizasyonları */
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
    /* Scroll bar'ı tamamen gizle */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}



#Thumbs.dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    background: 
        linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(59, 130, 246, 0.1) 100%);
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2);
}



/* Webkit tabanlı tarayıcılar için scroll bar'ı gizle */
#Thumbs::-webkit-scrollbar {
    display: none;
}

#Thumbs img {
    height: 110px;
    width: auto;
    border-radius: 16px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    flex-shrink: 0;
    object-fit: cover;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    background: white;
    scroll-snap-align: center;
    touch-action: manipulation;
}

#Thumbs img:hover {
    border-color: var(--primary-blue);
    transform: scale(1.08) translateY(-4px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2);
    z-index: 10;
    position: relative;
}

#Thumbs img.active {
    border-color: var(--primary-blue);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
    transform: scale(1.1) translateY(-6px);
    z-index: 10;
    position: relative;
}

/* GENEL ANİMASYONLAR */
.button-clicked {
    animation: buttonPress 0.1s ease;
}

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

/* GERİ BİLDİRİM MESAJLARI */
.feedback-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    font-size: 14px;
    font-weight: 500;
    max-width: 300px;
    animation: slideIn 0.3s ease;
}

.feedback-message.success {
    border-left: 4px solid var(--success-green);
    background: #f0fdf4;
}

.feedback-message.info {
    border-left: 4px solid var(--primary-blue);
    background: #eff6ff;
}

.feedback-message.warning {
    border-left: 4px solid var(--warning-orange);
    background: #fffbeb;
}

.feedback-message.error {
    border-left: 4px solid var(--error-red);
    background: #fef2f2;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* RESPONSİVE TASARIM - TOOLBOX OPTİMİZASYONU */
@media (max-width: 1024px) {
    .floating-toolbox {
        width: 300px;
        top: 15px;
        right: 15px;
        max-height: 60vh;
    }
    
    .drawing-toolbox {
        width: 260px;
        top: 15px;
        left: 15px;
        max-height: 45vh;
    }
    
    .tool-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .drawing-tool-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .thumbnails {
        height: 240px;
        padding: 18px;
    }
    
    #Thumbs {
        max-height: 140px;
        padding: 20px 24px;
        gap: 14px;
        /* Mobile için scroll optimizasyonu */
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
        overscroll-behavior-x: contain;
        scroll-behavior: auto; /* Mobile'da smooth scroll performans sorunu yaratabilir */
    }
    
    #Thumbs img {
        height: 95px;
    }
}

@media (max-width: 768px) {
    .maindiv {
        padding: 8px;
        gap: 8px;
    }
    
    /* Performance optimization - enhanced mobile patterns */
    body {
        background: 
            /* Enhanced but optimized patterns for mobile */
            radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.03) 0%, transparent 50%),
            linear-gradient(135deg, #f0f4f8 0%, #ffffff 40%, #f1f5f9 100%);
        background-attachment: scroll; /* Better performance on mobile */
    }
    
    body::before {
        background-image: 
            radial-gradient(circle, rgba(37, 99, 235, 0.015) 1px, transparent 1px);
        background-size: 30px 30px;
    }
    
    body::after {
        display: none; /* Remove complex animations on mobile */
    }
    
    .page-display {
        background: 
            /* Enhanced grid for mobile */
            linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px),
            linear-gradient(0deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px),
            linear-gradient(135deg, rgba(248, 250, 252, 0.96) 0%, rgba(255, 255, 255, 0.92) 50%, rgba(241, 245, 249, 0.96) 100%);
        background-size: 25px 25px, 25px 25px, 100% 100%;
        backdrop-filter: blur(8px); /* Reduce blur for performance */
        border: 1px solid rgba(37, 99, 235, 0.08);
    }
    
    .page-display::before {
        display: none; /* Remove complex overlays on mobile */
    }
    
    .floating-toolbox {
        top: 10px;
        right: 10px;
        width: 280px;
        max-height: 45vh;
        font-size: 12px;
    }
    
    .page-canvas-container {
        max-width: 95%;
        max-height: 90%;
    }
    
    .drawing-toolbox {
        top: 10px;
        left: 10px;
        width: 240px;
        max-height: 40vh;
    }
    
    .tool-buttons {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .drawing-tool-buttons {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }
    
    .drawing-tool-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .color-btn {
        width: 24px;
        height: 24px;
    }
    
    button[id*="videosol"],
    button[id*="musicsol"],
    button[id*="yonergesol"],
    button[id*="sescalsol"] {
        min-height: 45px;
        font-size: 9px;
        padding: 8px 4px;
    }
    
    button[id*="videosol"] i,
    button[id*="musicsol"] i,
    button[id*="yonergesol"] i,
    button[id*="sescalsol"] i {
        font-size: 12px;
    }
    
    .thumbnails {
        height: 200px;
        padding: 16px;
    }
    
    #Thumbs {
        max-height: 120px;
        padding: 18px 22px;
        gap: 12px;
        /* Mobile için ekstra optimizasyonlar */
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
        overscroll-behavior-x: contain;
        scroll-behavior: auto;
        /* Mobile için momentum scroll */
        scroll-snap-type: x proximity;
    }
    
    #Thumbs img {
        height: 80px;
        /* Mobile touch optimizasyonu */
        touch-action: manipulation;
    }
    

    
    .control-buttons {
        top: 440px !important;
        left: 10px !important;
        width: 180px;
        padding: 12px;
        gap: 8px;
    }
    
    .page-selector-btn,
    .double-page-btn,
    .back-to-main-btn {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .page-selector-btn i,
    .double-page-btn i,
    .back-to-main-btn i {
        font-size: 14px;
        width: 18px;
    }
}

@media (max-width: 480px) {
    .floating-toolbox {
        width: 260px;
        top: 5px;
        right: 5px;
        max-height: 40vh;
    }
    
    .page-canvas-container {
        max-width: 98%;
        max-height: 85%;
    }
    
    .drawing-toolbox {
        width: 200px;
        top: 5px;
        left: 5px;
        max-height: 35vh;
    }
    
    .tool-buttons {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .drawing-tool-buttons {
        grid-template-columns: repeat(4, 1fr);
        gap: 3px;
    }
    
    .drawing-tool-btn {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }
    
    .color-btn {
        width: 20px;
        height: 20px;
    }
    
    .drawing-control-btn {
        padding: 6px 8px;
        font-size: 10px;
    }
    
    .toolbox-title,
    .drawing-toolbox-title {
        font-size: 11px;
    }
    
    .tool-group,
    .drawing-tool-group {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    button[id*="videosol"],
    button[id*="musicsol"],
    button[id*="yonergesol"],
    button[id*="sescalsol"] {
        min-height: 40px;
        font-size: 8px;
        padding: 6px 3px;
    }
    
    button[id*="videosol"] i,
    button[id*="musicsol"] i,
    button[id*="yonergesol"] i,
    button[id*="sescalsol"] i {
        font-size: 10px;
    }
    
    .thumbnails {
        height: 180px;
        padding: 14px;
    }
    
    #Thumbs {
        max-height: 100px;
        padding: 16px 20px;
        gap: 10px;
        /* Küçük ekranlar için scroll optimizasyonu */
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
        overscroll-behavior-x: contain;
        scroll-behavior: auto;
        scroll-snap-type: x proximity;
    }
    
    #Thumbs img {
        height: 70px;
        /* Touch optimizasyonu */
        touch-action: manipulation;
        scroll-snap-align: center;
    }
    

    
    /* Mobilde panel butonlarını optimize et */
    #Panel {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    #Panel a,
    #Panel button {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .close-thumbnails-btn {
        margin-left: 0 !important;
    }
}

/* HOVER ANİMASYONLARI */
.floating-toolbox:hover {
    box-shadow: var(--shadow-xl);
}

button[id*="videosol"]:active,
button[id*="musicsol"]:active,
button[id*="yonergesol"]:active,
button[id*="sescalsol"]:active {
    transform: scale(0.98);
}

/* CHECK İKONLARI İÇİN STİL KURALLARI */
.color-btn .fa-check {
    display: none !important;
    color: white !important;
    font-size: 12px !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    font-weight: bold !important;
    pointer-events: none !important;
}

.color-btn.active .fa-check {
    display: block !important;
}

/* Tüm renk butonlarından active class'ı kaldırma kuralı */
.color-btn:not(.active) .fa-check {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Varsayılan kırmızı renk kuralı JavaScript ile kontrol ediliyor */