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

:root {
    --primary-color: #2c5f2d;
    --secondary-color: #97cc04;
    --accent-color: #d4af37;
    --text-dark: #1a1a1a;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --font-size-base: 16px;
}

body {
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.arabic-text {
    font-family: 'Amiri', 'Traditional Arabic', 'Arabic Typesetting', serif !important;
    font-size: 1.3em;
    line-height: 1.8;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 50px rgba(0,0,0,0.1);
    overflow-x: hidden;
}

.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a4d1a 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.logo-area h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.main-nav {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s;
    background: rgba(255,255,255,0.1);
}

.main-nav a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.main-nav a.active {
    background: rgba(212, 175, 55, 0.3);
    border-bottom: 3px solid var(--accent-color);
    font-weight: 600;
}

.main-content {
    padding: 3rem 2rem;
    min-height: calc(100vh - 250px);
}

.search-container {
    max-width: 1000px;  /* Genişletildi: arama kutusu daha geniş dursun */
    margin: 0 auto;
}

.search-box {
    background: white;
    padding: 0.8rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 0.4rem; /* Klavye ile arası ~sıfıra yakın (madde D) */
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.search-box label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 500;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.search-input {
    width: 100%;
    padding: 0.4rem 1.2rem;
    font-size: 4.2rem;
    font-weight: normal;
    height: 110px;          /* Büyütülen yazı + hareke sığsın */
    line-height: 1.4;      /* Harekenin üst/alt taşması için pay */
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem; /* Klavyeye yakın dursun (boşluk az) */
    transition: all 0.3s;
    cursor: pointer;
    text-align: center;    /* Kelime ortada görünsün */
    -webkit-user-select: text;
    user-select: text;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.1);
}

.search-input::placeholder {
    font-size: 1.6rem;
    font-weight: normal;
}

.keyboard-btn, .search-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-width: 140px;
    height: 50px;
}

.keyboard-btn {
    background: var(--secondary-color);
    color: white;
}

.search-btn {
    background: var(--primary-color);
    color: white;
}

.keyboard-btn:hover, .search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.arabic-keyboard {
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 1rem;
    margin: 0 auto;        /* Arama kutusunun hemen altında (boşluk yok) */
    box-shadow: var(--shadow);
    max-width: 860px;      /* Büyütüldü: kaldırılan kutulardan açılan yer (madde D17) */
}

.arabic-keyboard.hidden {
    display: none;
}

.keyboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
}

.keyboard-header span {
    font-weight: 500;
    color: var(--primary-color);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .keyboard-header {
        margin-bottom: 0.4rem;
        padding-bottom: 0.3rem;
    }
    
    .keyboard-header span {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .keyboard-header {
        margin-bottom: 0.3rem;
        padding-bottom: 0.2rem;
    }
    
    .keyboard-header span {
        font-size: 0.7rem;
    }
}

.close-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: #c82333;
    transform: rotate(90deg);
}

@media (max-width: 768px) {
    .close-btn {
        width: 22px;
        height: 22px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .close-btn {
        width: 20px;
        height: 20px;
        font-size: 0.8rem;
    }
}

.keyboard-keys {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .keyboard-keys {
        gap: 5px;
        margin-bottom: 0.6rem;
    }
}

@media (max-width: 480px) {
    .keyboard-keys {
        gap: 3px;
        margin-bottom: 0.5rem;
    }
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.keyboard-row.hareke-row {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .keyboard-row.hareke-row {
        margin-top: 3px;
        padding-top: 4px;
    }
}

@media (max-width: 480px) {
    .keyboard-row.hareke-row {
        margin-top: 2px;
        padding-top: 3px;
    }
}

.key-btn {
    padding: 10px 10px;
    font-size: 2.8rem;
    font-weight: bold;
    min-width: 54px;
    height: 54px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Amiri', 'Traditional Arabic', serif;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key-btn.hareke-key {
    min-width: 42px;
    height: 42px;
    font-size: 1.9rem;
    font-weight: bold;
    background: #f8f9fa;
}

.key-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.key-btn:active {
    transform: translateY(0);
    background: var(--primary-color);
    color: white;
}

.keyboard-footer {
    display: flex;
    gap: 8px;
}

@media (max-width: 768px) {
    .keyboard-footer {
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .keyboard-footer {
        gap: 3px;
    }
}

.space-btn {
    flex: 2;
    font-size: 1.3rem;
    font-weight: bold;
    padding: 12px 16px;
    height: 48px;
}

.backspace-btn, .clear-btn {
    flex: 1;
    background: #6c757d;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 12px 16px;
    height: 48px;
}

.backspace-btn:hover, .clear-btn:hover {
    background: #5a6268;
}

.suggestions-box {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.suggestions-box.hidden {
    display: none;
}

.suggestion-item {
    padding: 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggestion-item:hover {
    background: var(--bg-light);
    padding-left: 1.5rem;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.results-container {
    margin-top: 2rem;
}

.results-container.hidden {
    display: none;
}

.results-container h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.results-list {
    display: grid;
    gap: 1rem;
}

.result-item {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid var(--primary-color);
}

.result-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.result-word {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.result-page {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.page-viewer {
    max-width: 1000px;
    margin: 0 auto;
}

.page-viewer.hidden, .sections-content.hidden {
    display: none;
}

/* Arama kelimesi vurgulama */
.search-highlight {
    background-color: #ffeb3b !important;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
    box-shadow: 0 0 5px rgba(255, 235, 59, 0.5);
    transition: all 0.3s ease;
    animation: pulse 1.5s ease-in-out;
}

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

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1mm;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 10px;
    position: relative;
    z-index: 10;
}

.close-viewer-btn {
    padding: 0.8rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.close-viewer-btn:hover {
    background: #1a4d1a;
    transform: translateX(-3px);
}

.close-viewer-btn:active {
    background: #1a4d1a;
    transform: scale(0.95);
}

.font-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.font-controls button {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-color);
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.font-controls button:hover {
    background: var(--primary-color);
    color: white;
}

.page-content {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    line-height: 2;
    font-size: var(--font-size-base);
}

.sections-content {
    max-width: 900px;
    margin: 0 auto;
}

#section-text {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    line-height: 1.8;
}

.footer {
    background: var(--text-dark);
    color: white;
    padding: 2rem;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.visitor-count {
    margin-top: 1rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .logo-area h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .main-nav {
        gap: 0.8rem;
    }
    
    .main-nav a {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .main-content {
        padding: 1.5rem 1rem;
    }
    
    .search-box {
        padding: 1rem;
    }
    
    .search-box label {
        font-size: 0.9rem;
    }
    
    .search-input {
        font-size: 2.3rem;
        font-weight: bold;
        padding: 0.8rem 1rem;
        height: 58px;
        -webkit-touch-callout: none;
        -webkit-user-select: text;
        user-select: text;
    }
    
    .search-input::placeholder {
        font-size: 1rem;
    }
    
    .keyboard-btn, .search-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        min-width: 120px;
        height: 45px;
    }
    
    .button-group {
        gap: 0.8rem;
    }
    
    .arabic-keyboard {
        padding: 0.6rem;
        max-width: 100%;
    }
    
    .keyboard-row {
        gap: 3px;
    }
    
    .key-btn {
        padding: 4px 6px;
        font-size: 1.2rem;
        font-weight: bold;
        min-width: 30px;
        height: 34px;
    }
    
    .key-btn.hareke-key {
        min-width: 26px;
        height: 30px;
        font-size: 1rem;
        font-weight: bold;
    }
    
    .space-btn {
        font-size: 0.95rem;
        font-weight: bold;
        padding: 8px 10px;
        height: 34px;
    }
    
    .backspace-btn, .clear-btn {
        font-size: 0.9rem;
        font-weight: bold;
        padding: 8px 10px;
        height: 34px;
    }
    
    .viewer-header {
        flex-direction: column;
        gap: 1rem;
        padding: 0.8rem;
    }
    
    .viewer-controls {
        width: 100%;
        justify-content: center;
    }
    
    .nav-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .page-indicator {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
        min-width: 100px;
    }
    
    .zoom-controls {
        width: 100%;
        justify-content: center;
        gap: 0.8rem;
        position: relative;
        z-index: 100;
    }
    
    .zoom-controls button {
        padding: 0.7rem 1.2rem;
        font-size: 1rem;
        min-width: 48px;
        min-height: 44px;
        font-weight: 600;
        pointer-events: auto;
        z-index: 100;
    }
    
    .page-content {
        padding: 1.5rem;
        font-size: 0.9rem;
    }
    
    .result-item {
        padding: 1rem;
    }
    
    .result-word {
        font-size: 1.3rem;
    }
    
    .footer {
        padding: 1.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Küçük mobil cihazlar için */
@media (max-width: 480px) {
    .logo-area h1 {
        font-size: 1.3rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .main-nav {
        gap: 0.5rem;
    }
    
    .main-nav a {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .search-box {
        padding: 0.8rem;
    }
    
    .search-input {
        font-size: 2.1rem;
        font-weight: bold;
        padding: 0.7rem 0.9rem;
        height: 54px;
        -webkit-touch-callout: none;
        -webkit-user-select: text;
        user-select: text;
    }
    
    .search-input::placeholder {
        font-size: 0.85rem;
    }
    
    .keyboard-btn, .search-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
        min-width: 110px;
        height: 42px;
    }
    
    .button-group {
        gap: 0.6rem;
        flex-wrap: wrap;
    }
    
    .arabic-keyboard {
        padding: 0.5rem;
    }
    
    .keyboard-row {
        gap: 2px;
    }
    
    .key-btn {
        padding: 3px 5px;
        font-size: 1rem;
        font-weight: bold;
        min-width: 26px;
        height: 30px;
    }
    
    .key-btn.hareke-key {
        min-width: 24px;
        height: 28px;
        font-size: 0.9rem;
        font-weight: bold;
    }
    
    .space-btn {
        font-size: 0.85rem;
        font-weight: bold;
        padding: 6px 8px;
        height: 30px;
    }
    
    .backspace-btn, .clear-btn {
        font-size: 0.8rem;
        font-weight: bold;
        padding: 6px 8px;
        height: 30px;
    }
    
    .nav-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .nav-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .zoom-controls {
        gap: 0.6rem;
        z-index: 100;
    }
    
    .zoom-controls button {
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
        min-width: 44px;
        min-height: 40px;
        pointer-events: auto;
        z-index: 100;
    }
    
    .page-content {
        padding: 1rem;
        font-size: 0.85rem;
    }
    
    .result-item {
        padding: 0.8rem;
    }
    
    .result-word {
        font-size: 1.2rem;
    }
    
    .pdf-container {
        padding: 0.5rem;
    }
}

/* Çok küçük mobil cihazlar için (iPhone 13 mini, iPhone SE) */
@media (max-width: 390px) {
    .logo-area h1 {
        font-size: 1.2rem;
    }
    
    .subtitle {
        font-size: 0.75rem;
    }
    
    .header {
        padding: 1.5rem 1rem;
    }
    
    .main-nav {
        gap: 0.4rem;
    }
    
    .main-nav a {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .main-content {
        padding: 1.2rem 0.8rem;
    }
    
    .search-box {
        padding: 0.6rem;
    }
    
    .search-input {
        font-size: 1.9rem;
        padding: 0.6rem 0.8rem;
        height: 52px;
    }
    
    .search-input::placeholder {
        font-size: 0.8rem;
    }
    
    .keyboard-btn, .search-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        min-width: 100px;
        height: 40px;
    }
    
    .arabic-keyboard {
        padding: 0.4rem;
    }
    
    .keyboard-header {
        margin-bottom: 0.2rem;
        padding-bottom: 0.2rem;
    }
    
    .keyboard-header span {
        font-size: 0.65rem;
    }
    
    .keyboard-row {
        gap: 1.5px;
    }
    
    .key-btn {
        padding: 2px 4px;
        font-size: 0.9rem;
        min-width: 24px;
        height: 28px;
    }
    
    .key-btn.hareke-key {
        min-width: 22px;
        height: 26px;
        font-size: 0.8rem;
    }
    
    .space-btn {
        font-size: 0.75rem;
        padding: 5px 6px;
        height: 28px;
    }
    
    .backspace-btn, .clear-btn {
        font-size: 0.7rem;
        padding: 5px 6px;
        height: 28px;
    }
    
    .keyboard-keys {
        gap: 2px;
        margin-bottom: 0.4rem;
    }
    
    .keyboard-footer {
        gap: 2px;
    }
    
    .footer {
        padding: 1.2rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* En küçük mobil cihazlar için (iPhone SE 1st gen, küçük Android'ler) */
@media (max-width: 360px) {
    .logo-area h1 {
        font-size: 1.1rem;
    }
    
    .subtitle {
        font-size: 0.7rem;
    }
    
    .header {
        padding: 1.2rem 0.8rem;
    }
    
    .main-nav {
        gap: 0.3rem;
    }
    
    .main-nav a {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .main-content {
        padding: 1rem 0.5rem;
    }
    
    .search-box {
        padding: 0.5rem;
    }
    
    .search-input {
        font-size: 1.8rem;
        padding: 0.5rem 0.7rem;
        height: 50px;
    }
    
    .search-input::placeholder {
        font-size: 0.75rem;
    }
    
    .keyboard-btn, .search-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        min-width: 90px;
        height: 38px;
    }
    
    .button-group {
        gap: 0.4rem;
    }
    
    .arabic-keyboard {
        padding: 0.3rem;
    }
    
    .keyboard-header {
        margin-bottom: 0.2rem;
        padding-bottom: 0.1rem;
    }
    
    .keyboard-header span {
        font-size: 0.6rem;
    }
    
    .close-btn {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }
    
    .keyboard-row {
        gap: 1px;
    }
    
    .key-btn {
        padding: 2px 3px;
        font-size: 0.85rem;
        min-width: 22px;
        height: 26px;
    }
    
    .key-btn.hareke-key {
        min-width: 20px;
        height: 24px;
        font-size: 0.75rem;
    }
    
    .space-btn {
        font-size: 0.7rem;
        padding: 4px 5px;
        height: 26px;
    }
    
    .backspace-btn, .clear-btn {
        font-size: 0.65rem;
        padding: 4px 5px;
        height: 26px;
    }
    
    .keyboard-keys {
        gap: 1.5px;
        margin-bottom: 0.3rem;
    }
    
    .keyboard-footer {
        gap: 1.5px;
    }
    
    .keyboard-row.hareke-row {
        margin-top: 1.5px;
        padding-top: 2px;
    }
}

/* Landscape mod için mobil */
@media (max-width: 768px) and (orientation: landscape) {
    .abbreviations-panel {
        max-height: 85vh;
    }
    
    .floating-open-btn {
        bottom: 20px;
        width: 50px;
        height: 50px;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .viewer-header {
        padding: 0.5rem;
    }
}

/* Tablet portrait */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .container {
        max-width: 100%;
    }

    .search-container {
        max-width: 850px;
    }
    
    .page-content {
        padding: 2rem;
    }
    
    .viewer-controls {
        gap: 0.8rem;
    }
}

/* Tablet landscape */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .container {
        max-width: 100%;
    }
    
    .main-content {
        padding: 2rem 1.5rem;
    }
    
    .abbreviations-panel {
        max-height: 90vh;
    }
}

.loader {
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ====== PDF VIEWER & BOOK STYLES ====== */

.book-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    max-width: 1400px;
    margin: 2rem auto;
    perspective: 2000px;
    min-height: 800px;
}

.book-page {
    width: 45%;
    background: white;
    padding: 3rem 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    position: relative;
    transition: transform 0.6s cubic-bezier(0.645, 0.045, 0.355, 1);
    transform-style: preserve-3d;
}

.left-page {
    border-radius: 10px 0 0 10px;
    border-right: 1px solid #ddd;
}

.right-page {
    border-radius: 0 10px 10px 0;
    border-left: 1px solid #ddd;
}

.book-spine {
    width: 40px;
    background: linear-gradient(to right, 
        rgba(0,0,0,0.1) 0%, 
        rgba(0,0,0,0.05) 50%, 
        rgba(0,0,0,0.1) 100%
    );
    box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
}

.page-content-wrapper {
    min-height: 700px;
    font-size: 16px;
    line-height: 1.8;
    direction: rtl;
    text-align: right;
}

/* Word formatları için özel stiller */
.page-content-wrapper .blue-text {
    color: #0000FF;
    font-weight: 500;
}

.page-content-wrapper .red-text {
    color: #FF0000;
    font-weight: 500;
}

.page-content-wrapper .black-text {
    color: #000000;
}

.page-content-wrapper .arabic-text {
    font-family: 'Amiri', 'Traditional Arabic', serif !important;
    font-size: 1.4em;
    line-height: 2;
}

.page-content-wrapper .bold-text {
    font-weight: bold;
}

.page-content-wrapper .italic-text {
    font-style: italic;
}

.page-content-wrapper .underlined-text {
    text-decoration: underline;
}

.page-content-wrapper .text-run {
    margin: 0.5rem 0;
}

.page-number {
    position: absolute;
    bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.left-page .page-number {
    left: 2rem;
}

.right-page .page-number {
    right: 2rem;
}

/* Sayfa çevirme animasyonu */
.book-page.flipping {
    animation: pageFlip 0.6s ease-in-out;
}

@keyframes pageFlip {
    0% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(-90deg);
        opacity: 0.5;
    }
    100% {
        transform: rotateY(0deg);
    }
}

/* Viewer kontrolleri */
.viewer-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.nav-btn:hover:not(:disabled) {
    background: #1a4d1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.nav-btn:active:not(:disabled) {
    background: #1a4d1a;
    transform: scale(0.95);
}

.nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.page-indicator {
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border-radius: 20px;
    font-weight: 500;
    color: var(--primary-color);
    min-width: 120px;
    text-align: center;
}

/* Responsive tasarım */
@media (max-width: 1200px) {
    .book-container {
        flex-direction: column;
        align-items: center;
    }
    
    .book-page {
        width: 90%;
        margin: 1rem 0;
    }
    
    .left-page, .right-page {
        border-radius: 10px;
        border: 1px solid #ddd;
    }
    
    .book-spine {
        display: none;
    }
}

@media (max-width: 768px) {
    .book-page {
        width: 95%;
        padding: 2rem 1.5rem;
    }
    
    .page-content-wrapper {
        min-height: 500px;
        font-size: 14px;
    }
    
    .viewer-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .viewer-header {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Yazdırma stilleri */
@media print {
    .viewer-header, .footer {
        display: none !important;
    }
    
    .book-container {
        box-shadow: none;
    }
    
    .book-page {
        box-shadow: none;
        page-break-after: always;
    }
}
/* PDF Viewer Stilleri */
.pdf-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    background: #525659;
    min-height: 600px;
    max-height: 85vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    position: relative;
}

.pdf-container.dragging {
    cursor: grabbing;
    user-select: none;
}

#pdf-canvas {
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    background: white;
    display: block;
    max-width: none;
    height: auto;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 10;
}

.zoom-controls button {
    padding: 0.6rem 1.1rem;
    min-height: 48px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    transition: all 0.2s;
    position: relative;
    z-index: 10;
}

.zoom-controls button:hover {
    background: #1a4d1a;
}

.zoom-controls button:active {
    background: #1a4d1a;
    transform: scale(0.95);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
}

#zoom-level {
    min-width: 60px;
    text-align: center;
    font-weight: 500;
}

@media (max-width: 768px) {
    .pdf-container {
        padding: 1rem;
        overflow: scroll;
    }
    
    #pdf-canvas {
        max-width: none;
        width: auto;
        height: auto;
    }
}

/* ====== KISALTMALAR PANELİ ====== */
.abbreviations-panel {
    position: fixed;
    right: -400px;
    top: 50%;
    transform: translateY(-50%);
    width: 380px;
    max-height: 85vh;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px 0 0 20px;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    transition: right 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid var(--primary-color);
    border-right: none;
}

.abbreviations-panel.visible {
    right: 0;
}

.abbreviations-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a4d1a 100%);
    color: white;
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.abbreviations-header h3 {
    font-size: 1.2rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.close-panel-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    width: 35px;
    height: 35px;
}

.close-panel-btn:hover {
    background: rgba(255, 0, 0, 0.8);
    transform: scale(1.1) rotate(90deg);
}

/* Floating Açma Butonu */
.floating-open-btn {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a4d1a 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px 0 0 50px;
    cursor: pointer;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    box-shadow: -5px 5px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.4s ease;
    z-index: 999;
    font-size: 0.85rem;
    font-weight: 600;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.floating-open-btn.show {
    display: flex;
}

.floating-open-btn:hover {
    background: linear-gradient(135deg, #1a4d1a 0%, var(--primary-color) 100%);
    transform: translateY(-50%) translateX(-5px);
    box-shadow: -8px 8px 25px rgba(0, 0, 0, 0.4);
}

.floating-open-btn svg {
    transform: rotate(90deg);
    margin-bottom: 0.5rem;
}

.abbreviations-search {
    padding: 1rem 1.5rem;
    background: white;
    border-bottom: 2px solid var(--border-color);
}

.abbreviations-search input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: var(--bg-light);
}

.abbreviations-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.1);
}

.abbreviations-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-light);
}

.abbreviations-content::-webkit-scrollbar {
    width: 8px;
}

.abbreviations-content::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 10px;
}

.abbreviations-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
    transition: background 0.3s;
}

.abbreviations-content::-webkit-scrollbar-thumb:hover {
    background: #1a4d1a;
}

.abbreviation-item {
    display: flex;
    flex-direction: column;
    padding: 0.9rem 1rem;
    margin: 0.4rem 0.5rem;
    background: white;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.abbreviation-item:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-left-color: var(--accent-color);
}

.abbr-code {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
    font-family: 'Amiri', serif;
    letter-spacing: 0.5px;
}

.abbr-meaning {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
    font-style: italic;
}

/* Mobil uyumluluk */
@media (max-width: 768px) {
    .abbreviations-panel {
        right: auto;
        left: 0;
        bottom: -100%;
        top: auto;
        transform: none;
        width: 100%;
        max-width: 100%;
        max-height: 70vh;
        border-radius: 20px 20px 0 0;
        border: 2px solid var(--primary-color);
        border-bottom: none;
        transition: bottom 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }
    
    .abbreviations-panel.visible {
        bottom: 0;
        right: auto;
    }
    
    .abbreviations-header {
        padding: 1rem;
        cursor: grab;
        position: relative;
    }
    
    .abbreviations-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.5);
        border-radius: 2px;
    }
    
    .abbreviations-header h3 {
        font-size: 1rem;
        margin-top: 0.5rem;
    }
    
    .floating-open-btn {
        right: 15px;
        bottom: 80px;
        top: auto;
        transform: none;
        border-radius: 50%;
        width: 60px;
        height: 60px;
        padding: 0;
        writing-mode: horizontal-tb;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    .floating-open-btn:hover {
        transform: scale(1.1);
    }
    
    .floating-open-btn svg {
        transform: rotate(0deg);
        margin: 0;
    }
    
    .floating-open-btn span {
        display: none;
    }
    
    .abbreviation-item {
        padding: 0.7rem 0.8rem;
        margin: 0.3rem 0.3rem;
    }
    
    .abbr-code {
        font-size: 0.95rem;
    }
    
    .abbr-meaning {
        font-size: 0.85rem;
    }
}

/* Tablet görünümü */
@media (min-width: 769px) and (max-width: 1024px) {
    .abbreviations-panel {
        width: 320px;
        right: -320px;
    }
    
    .floating-open-btn {
        right: 15px;
        padding: 0.8rem 1.2rem;
    }
}

/* Çok büyük ekranlar için */
@media (min-width: 1600px) {
    .abbreviations-panel {
        width: 420px;
        right: -420px;
    }
}

/* Animasyonlar */
@keyframes slideInRight {
    from {
        right: -380px;
        opacity: 0;
    }
    to {
        right: 0;
        opacity: 1;
    }
}

@keyframes slideInBottom {
    from {
        bottom: -100%;
        opacity: 0;
    }
    to {
        bottom: 0;
        opacity: 1;
    }
}

.abbreviations-panel.visible {
    animation: slideInRight 0.5s ease-out;
}

@media (max-width: 768px) {
    .abbreviations-panel.visible {
        animation: slideInBottom 0.5s ease-out;
    }
}

/* Yazdırma için gizle */
@media print {
    .abbreviations-panel,
    .floating-open-btn {
        display: none !important;
    }
}

/* ====== ÖNSÖZ VE TEŞEKKÜR SAYFALARI ====== */
.content-page {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    animation: fadeInUp 0.6s ease-out;
}

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

.content-page h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--accent-color);
    position: relative;
    font-weight: 700;
}

.content-page h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--primary-color);
}

.content-page h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin: 2rem 0 1rem 0;
    font-weight: 600;
    border-left: 5px solid var(--accent-color);
    padding-left: 1rem;
}

.content-page p {
    line-height: 2;
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: justify;
    text-indent: 2rem;
}

.content-page p:first-of-type {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--primary-color);
    text-indent: 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(44, 95, 45, 0.05) 0%, rgba(151, 204, 4, 0.05) 100%);
    border-left: 5px solid var(--accent-color);
    border-radius: 0 10px 10px 0;
    margin-bottom: 2rem;
}

.content-page ol {
    counter-reset: item;
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.content-page ol li {
    counter-increment: item;
    margin-bottom: 1.5rem;
    padding-left: 3rem;
    position: relative;
    line-height: 1.8;
    font-size: 1.05rem;
}

.content-page ol li::before {
    content: counter(item) ".";
    position: absolute;
    left: 0;
    top: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a4d1a 100%);
    color: white;
    font-weight: bold;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(44, 95, 45, 0.3);
}

.author-signature {
    text-align: right;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
    font-style: italic;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.2rem;
}

.author-signature span {
    display: block;
    font-size: 1rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    font-style: normal;
    font-weight: 400;
}

/* Teşekkür sayfası için özel stiller */
.thanks-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, rgba(255, 255, 255, 1) 100%);
    border-radius: 15px;
    border-left: 5px solid var(--accent-color);
}

.thanks-section strong {
    color: var(--primary-color);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Önsöz listesi için */
.intro-list {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 15px;
    margin: 2rem 0;
}

.highlight-box {
    background: linear-gradient(135deg, rgba(44, 95, 45, 0.1) 0%, rgba(151, 204, 4, 0.1) 100%);
    padding: 1.5rem;
    border-radius: 10px;
    margin: 2rem 0;
    border: 2px solid var(--accent-color);
}

.highlight-box p {
    text-indent: 0;
    margin-bottom: 1rem;
}

.highlight-box p:last-child {
    margin-bottom: 0;
}

/* Responsive tasarım */
@media (max-width: 768px) {
    .content-page {
        padding: 2rem 1.5rem;
        border-radius: 15px;
    }
    
    .content-page h2 {
        font-size: 1.8rem;
    }
    
    .content-page h3 {
        font-size: 1.4rem;
    }
    
    .content-page p {
        font-size: 1rem;
        line-height: 1.8;
        text-indent: 1rem;
    }
    
    .content-page ol li {
        padding-left: 2.5rem;
        font-size: 0.95rem;
    }
    
    .content-page ol li::before {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
    
    .author-signature {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .content-page {
        padding: 1.5rem 1rem;
    }
    
    .content-page h2 {
        font-size: 1.5rem;
    }
    
    .content-page h3 {
        font-size: 1.2rem;
        padding-left: 0.8rem;
    }
    
    .content-page p {
        font-size: 0.95rem;
        text-indent: 0.5rem;
    }
    
    .content-page ol li {
        padding-left: 2rem;
        font-size: 0.9rem;
    }
    
    .content-page ol li::before {
        width: 25px;
        height: 25px;
        font-size: 0.75rem;
    }
}

/* ========================================
   HARF NAVİGASYON SİSTEMİ
   ======================================== */

/* Harfler Butonu */
.letters-btn {
    background: linear-gradient(135deg, #97cc04 0%, #7ba903 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(151, 204, 4, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.letters-btn:hover {
    background: linear-gradient(135deg, #7ba903 0%, #6a9503 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(151, 204, 4, 0.4);
}

.letters-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(151, 204, 4, 0.3);
}

/* Harfler Container (Mavi Alan İçinde) - Klavye Boyutunda */
.letters-container {
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 1.2rem;
    margin: 0.8rem auto 0 auto;
    box-shadow: var(--shadow);
    max-width: 700px;
    animation: slideDown 0.3s ease;
}

.letters-container.hidden {
    display: none;
}

/* Container Header */
.letters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
}

.letters-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.letters-close {
    background: #dc3545;
    border: none;
    color: white;
    font-size: 1.2rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.letters-close:hover {
    background: #c82333;
    transform: rotate(90deg);
}

/* Harf Türü Tab'ları */
.letter-type-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.letter-tab {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.letter-tab:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.letter-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.letter-tab:active {
    transform: translateY(0);
}

.tab-icon {
    font-size: 1.1rem;
}

.tab-text {
    font-weight: 500;
}

/* Harf Grid (Harflerin listesi) - Klavye Stilinde */
.letters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 6px;
}

.letter-btn {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 48px;
}

.letter-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.letter-btn:active {
    transform: translateY(0);
    background: var(--primary-color);
    color: white;
}

.letter-btn:active .letter-char {
    color: white;
}

.letter-btn:active .letter-page {
    color: white;
}

.letter-char {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-dark);
    transition: all 0.3s ease;
    font-family: 'Amiri', 'Traditional Arabic', serif;
}

.letter-page {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: normal;
    transition: all 0.3s ease;
}

/* Animasyonlar */
@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive - Tablet */
@media (max-width: 768px) {
    .letters-container {
        padding: 1rem;
    }
    
    .letters-title {
        font-size: 0.95rem;
    }
    
    .letter-type-tabs {
        gap: 0.4rem;
    }
    
    .letter-tab {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .tab-icon {
        font-size: 1rem;
    }
    
    .letters-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 4px;
    }
    
    .letter-btn {
        padding: 6px 8px;
        min-width: 36px;
    }
    
    .letter-char {
        font-size: 1.4rem;
    }
    
    .letter-page {
        font-size: 0.65rem;
    }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    .letters-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .letters-container {
        padding: 0.8rem;
    }
    
    .letters-header {
        margin-bottom: 0.5rem;
        padding-bottom: 0.3rem;
    }
    
    .letters-title {
        font-size: 0.85rem;
    }
    
    .letters-close {
        width: 24px;
        height: 24px;
        font-size: 1rem;
    }
    
    .letter-type-tabs {
        gap: 0.3rem;
        margin-bottom: 0.6rem;
    }
    
    .letter-tab {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .tab-icon {
        font-size: 0.9rem;
    }
    
    .letters-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 3px;
    }
    
    .letter-btn {
        padding: 5px 7px;
        min-width: 30px;
    }
    
    .letter-char {
        font-size: 1.2rem;
    }
    
    .letter-page {
        font-size: 0.6rem;
    }
}

/* Çok küçük mobil cihazlar için - Letter Navigation */
@media (max-width: 390px) {
    .letters-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .letters-container {
        padding: 0.6rem;
    }
    
    .letters-header {
        margin-bottom: 0.4rem;
        padding-bottom: 0.2rem;
    }
    
    .letters-title {
        font-size: 0.8rem;
    }
    
    .letters-close {
        width: 22px;
        height: 22px;
        font-size: 0.9rem;
    }
    
    .letter-type-tabs {
        gap: 0.2rem;
        margin-bottom: 0.5rem;
    }
    
    .letter-tab {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .tab-icon {
        font-size: 0.85rem;
    }
    
    .letters-grid {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
        gap: 2px;
    }
    
    .letter-btn {
        padding: 4px 6px;
        min-width: 28px;
    }
    
    .letter-char {
        font-size: 1.1rem;
    }
    
    .letter-page {
        font-size: 0.55rem;
    }
}

/* En küçük mobil cihazlar için - Letter Navigation */
@media (max-width: 360px) {
    .letters-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
    }
    
    .letters-container {
        padding: 0.5rem;
    }
    
    .letters-header {
        margin-bottom: 0.3rem;
        padding-bottom: 0.2rem;
    }
    
    .letters-title {
        font-size: 0.75rem;
    }
    
    .letters-close {
        width: 20px;
        height: 20px;
        font-size: 0.85rem;
    }
    
    .letter-type-tabs {
        gap: 0.2rem;
        margin-bottom: 0.4rem;
    }
    
    .letter-tab {
        padding: 0.3rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .tab-icon {
        font-size: 0.8rem;
    }
    
    .letters-grid {
        grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
        gap: 1.5px;
    }
    
    .letter-btn {
        padding: 3px 5px;
        min-width: 26px;
    }
    
    .letter-char {
        font-size: 1rem;
    }
    
    .letter-page {
        font-size: 0.5rem;
    }
}

/* Aşırı küçük ekranlar için (320px - iPhone SE 1st gen gibi) */
@media (max-width: 320px) {
    .logo-area h1 {
        font-size: 1rem;
    }
    
    .subtitle {
        font-size: 0.65rem;
    }
    
    .header {
        padding: 1rem 0.6rem;
    }
    
    .main-nav {
        gap: 0.2rem;
        margin-top: 1rem;
    }
    
    .main-nav a {
        padding: 0.2rem 0.4rem;
        font-size: 0.65rem;
    }
    
    .main-content {
        padding: 0.8rem 0.4rem;
    }
    
    .search-box {
        padding: 0.4rem;
    }
    
    .search-input {
        font-size: 1.7rem;
        padding: 0.4rem 0.6rem;
        height: 48px;
    }
    
    .search-input::placeholder {
        font-size: 0.7rem;
    }
    
    .keyboard-btn, .search-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.75rem;
        min-width: 85px;
        height: 36px;
    }
    
    .button-group {
        gap: 0.3rem;
    }
    
    .arabic-keyboard {
        padding: 0.25rem;
    }
    
    .keyboard-header {
        margin-bottom: 0.15rem;
        padding-bottom: 0.1rem;
    }
    
    .keyboard-header span {
        font-size: 0.55rem;
    }
    
    .close-btn {
        width: 16px;
        height: 16px;
        font-size: 0.65rem;
    }
    
    .keyboard-row {
        gap: 0.5px;
    }
    
    .key-btn {
        padding: 1px 2px;
        font-size: 0.8rem;
        min-width: 20px;
        height: 24px;
    }
    
    .key-btn.hareke-key {
        min-width: 18px;
        height: 22px;
        font-size: 0.7rem;
    }
    
    .space-btn {
        font-size: 0.65rem;
        padding: 4px;
        height: 24px;
    }
    
    .backspace-btn, .clear-btn {
        font-size: 0.6rem;
        padding: 4px;
        height: 24px;
    }
    
    .keyboard-keys {
        gap: 1px;
        margin-bottom: 0.25rem;
    }
    
    .keyboard-footer {
        gap: 1px;
    }
    
    .keyboard-row.hareke-row {
        margin-top: 1px;
        padding-top: 1.5px;
    }
    
    /* Letter navigation */
    .letters-container {
        padding: 0.4rem;
    }
    
    .letters-title {
        font-size: 0.7rem;
    }
    
    .letters-close {
        width: 18px;
        height: 18px;
        font-size: 0.8rem;
    }
    
    .letter-tab {
        padding: 0.25rem 0.3rem;
        font-size: 0.65rem;
    }
    
    .tab-icon {
        font-size: 0.75rem;
    }
    
    .letters-grid {
        grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
        gap: 1px;
    }
    
    .letter-btn {
        padding: 2px 4px;
        min-width: 24px;
    }
    
    .letter-char {
        font-size: 0.95rem;
    }
    
    .letter-page {
        font-size: 0.45rem;
    }
    
    /* Footer */
    .footer {
        padding: 1rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* =====================================================================
   ARAYÜZ GÜNCELLEMESİ — UYARI.pdf talepleri
   Birinci/ikinci sayfa akışı, klavye içi fonksiyon kutuları,
   tanıtım videosu, sıkı boşluklar, büyütülmüş (+)/(−) butonları.
   ===================================================================== */

/* --- (+)/(−) zoom butonları: belirgin büyük (madde E18) --- */
#zoom-in, #zoom-out {
    font-size: 1.9rem;
    font-weight: bold;
    min-width: 58px;
    min-height: 52px;
    padding: 0.4rem 1rem;
}

/* --- BİRİNCİ SAYFA: tanıtım ekranı + video --- */
.intro-screen {
    max-width: 860px;
    margin: 0 auto 0.5rem auto;
}
.intro-screen.hidden { display: none; }

.intro-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a4d1a 100%);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.intro-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(44,95,45,0.35);
}
.intro-title {
    color: #fff;
    font-size: 1.9rem;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}
.intro-video-wrap {
    position: relative;
    aspect-ratio: 9 / 16;      /* Dikey video (1080x1920) */
    height: 62vh;
    max-height: 520px;
    width: auto;               /* Yükseklikten orana göre genişlik */
    margin: 0 auto;
    background: #0d2b0e;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
.intro-video {
    width: 100%;
    height: 100%;
    object-fit: cover;         /* Video tam 9:16, kırpılmaz */
    display: block;
}
@media (max-width: 768px) {
    .intro-video-wrap { height: 55vh; max-height: 440px; }
}
.intro-video-placeholder {
    color: rgba(255,255,255,0.85);
    text-align: center;
    padding: 1.5rem;
}
.intro-video-icon { font-size: 3rem; display: block; margin-bottom: 0.5rem; }
.intro-video-placeholder p { font-size: 1.05rem; margin-bottom: 0.3rem; }
.intro-video-placeholder small { opacity: 0.75; }
.intro-video-placeholder code {
    background: rgba(255,255,255,0.15);
    padding: 1px 6px;
    border-radius: 4px;
}
.intro-enter-hint {
    margin-top: 1rem;
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 1.05rem;
}

/* --- İKİNCİ SAYFA görünürlüğü: birinci-sayfa öğelerini gizle --- */
.search-container.search-mode .landing-only { display: none !important; }
.landing-only.hidden { display: none; }

/* --- KLAVYE İÇİ FONKSİYON KUTULARI: Edatlar · Tek Harfler · Sil · Temizle · Ara --- */
.keyboard-footer {
    flex-wrap: wrap;
    align-items: stretch;
}
.kb-fn-btn {
    flex: 0 1 auto;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #f1f3f5;
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.kb-fn-btn:hover { transform: translateY(-2px); box-shadow: 0 3px 8px rgba(0,0,0,0.12); }
.kb-fn-btn.fn-edat,
.kb-fn-btn.fn-harf {
    background: var(--secondary-color);
    color: #fff;
    border-color: var(--secondary-color);
}
.kb-fn-btn.fn-sil,
.kb-fn-btn.fn-temizle {
    background: #6c757d;
    color: #fff;
    border-color: #6c757d;
}
.kb-fn-btn.fn-ara {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    margin-left: auto; /* ARA en sağda (madde C15) */
    padding: 0 22px;
}
.kb-fn-btn.fn-ara:hover { background: #1a4d1a; }

/* Sadece masaüstü: Ara butonu biraz daha geniş */
@media (min-width: 769px) {
    .kb-fn-btn.fn-ara {
        min-width: 180px;
        padding: 0 40px;
    }
}

/* Mobil: fonksiyon kutuları düzgün grid olsun (2 sütun + altta tam genişlik Ara) */
@media (max-width: 768px) {
    .intro-title { font-size: 1.4rem; }
    .keyboard-footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .kb-fn-btn {
        margin: 0;
        width: 100%;
        height: 46px;
        font-size: 0.85rem;
        padding: 0 6px;
        white-space: normal;   /* uzun etiket alta sarsın */
        line-height: 1.1;
    }
    .kb-fn-btn.fn-ara {
        grid-column: 1 / -1;   /* Ara tam genişlik, en altta */
        margin: 0;
    }
}
@media (max-width: 480px) {
    .kb-fn-btn { font-size: 0.78rem; height: 44px; }
}