/* Reset ve Sıfırlamalar */
*, *::before, *::after {
    box-sizing: border-box;
    max-width: 100%;
}

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden !important;
    scroll-behavior: smooth;
    font-family: Arial, "Segoe UI", Helvetica, sans-serif;
    color: #2b2d42;
    background-color: #fcfbf7;
}

h1, h2, h3, h4, h5, .navbar-brand {
    /* Sistem yazı tipleri Türkçe karakterleri her cihazda yerel olarak destekler. */
    font-family: Arial, "Segoe UI", Helvetica, sans-serif;
    word-break: break-word;
}

/* Renk Paleti */
.bg-atesbogeci {
    background-color: #ffb703 !important;
}

.text-atesbogeci {
    color: #fb8500 !important;
}

/* Navbar */
.navbar {
    background-color: #ffffff !important;
    border-bottom: 4px solid #ffb703;
}

.brand-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
    border-radius: 50%;
}

.navbar-brand span {
    font-size: 1.1rem;
    white-space: normal;
}

/* Hero Bölümü */
.hero-section {
    background: linear-gradient(135deg, #fff3b0 0%, #cae9ff 100%);
    position: relative;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
}

.hero-main-img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(251, 133, 0, 0.15);
    border: 4px solid #ffffff;
}

.hero-image-open-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.hero-viewer-image {
    display: block;
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 12px;
}

.hero-picker-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #64748b;
    font-size: 0.85rem;
    margin: 1rem 0 0.7rem;
}

.hero-picker-divider::before,
.hero-picker-divider::after {
    content: '';
    height: 1px;
    background: #dbe3ea;
    flex: 1;
}

.hero-gallery-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    max-height: 13rem;
    overflow-y: auto;
    padding: 0.15rem;
}

.hero-gallery-choice {
    border: 2px solid transparent;
    padding: 0;
    border-radius: 0.65rem;
    overflow: hidden;
    aspect-ratio: 1 / 0.72;
    background: #eef2f7;
    transition: border-color 0.18s ease, transform 0.18s ease;
}

.hero-gallery-choice:hover,
.hero-gallery-choice:focus-visible {
    border-color: #0dcaf0;
    transform: scale(1.03);
    outline: none;
}

.hero-gallery-choice img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Kartlar */
.program-card {
    border: 2px solid #f0f0f0;
    border-radius: 20px;
    background: #ffffff;
    height: 100%;
}

/* Program kartları: yalnızca fareyle kullanılan cihazlarda hafif etkileşim */
#felsefemiz .program-card,
#programlar .program-card {
    transition: transform 180ms ease, box-shadow 180ms ease;
}

@media (hover: hover) and (pointer: fine) {
    #felsefemiz .program-card:hover,
    #programlar .program-card:hover {
        transform: scale(1.025);
        box-shadow: 0 12px 24px rgba(43, 45, 66, 0.12);
    }
}

.card-icon {
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: 16px;
    flex-shrink: 0;
}

/* Galeri Kutuları */
.gallery-img-container {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    height: 220px;
    border: 3px solid #ffffff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.06);
}

.gallery-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-open-btn {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.gallery-viewer-modal {
    background: #20212a;
}

.gallery-viewer-image {
    display: block;
    max-width: calc(100% - 110px);
    max-height: 72vh;
    object-fit: contain;
    border-radius: 10px;
}

.gallery-viewer-nav {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 50%;
}

.contact-map {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.map-frame {
    overflow: hidden;
    border: 2px solid rgba(255, 183, 3, 0.65);
    border-radius: 16px;
    background: #ffffff;
}

.map-frame iframe {
    display: block;
    width: 100%;
    height: 300px;
    border: 0;
}

.mobile-contact-bar {
    display: none;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 58px;
    }

    .mobile-contact-bar {
        position: fixed;
        z-index: 1030;
        right: 0;
        bottom: 0;
        left: 0;
        display: block;
        min-height: 50px;
        box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.16);
    }

    .mobile-contact-bar a {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 50px;
        color: #ffffff;
        font-size: 0.92rem;
        font-weight: 600;
        text-decoration: none;
    }

    .mobile-contact-bar i {
        font-size: 1.05rem;
    }

    .mobile-whatsapp-link {
        background: #198754;
    }
}

@media (max-width: 576px) {
    .gallery-viewer-modal .modal-header {
        padding: 0.9rem 1rem;
    }

    .gallery-viewer-image {
        max-width: calc(100% - 76px);
        max-height: 65vh;
    }

    .gallery-viewer-nav {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        padding: 0;
    }
}

.gallery-delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

/* Accordion */
.accordion-item {
    border-radius: 12px !important;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
}

.accordion-button {
    font-size: 0.95rem;
    padding: 12px 15px;
}

.accordion-button:not(.collapsed) {
    background-color: #fff8e7;
    color: #fb8500;
    font-weight: bold;
}

/* Form Stilleri */
.style-form-section {
    background: linear-gradient(180deg, #fcfbf7 0%, #fff8e7 100%);
}

.form-card {
    border: 2px solid #ffb703 !important;
    background-color: #ffffff;
    border-radius: 24px !important;
}

.custom-input {
    border: 2px solid #eee !important;
    padding: 10px 14px;
    background-color: #fafafa;
}

/* Footer */
footer {
    background-color: #1e293b;
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
}

/* ================================
   RESPONSIVE / MOBİL DÜZEN
   ================================ */

/* Bootstrap navbar 992px altında menüye geçiyor; bu aralıkta da
   logo + hamburger + menü taşmasını engelliyoruz. */
@media (max-width: 991.98px) {
    .navbar {
        padding-top: 0.65rem !important;
        padding-bottom: 0.65rem !important;
    }

    .navbar > .container {
        position: relative;
    }

    .navbar-brand {
        min-width: 0;
        max-width: calc(100% - 58px);
        margin-right: 0;
        line-height: 1.15;
    }

    .navbar-brand span {
        font-size: clamp(0.88rem, 3.8vw, 1.05rem);
    }

    .brand-logo {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
    }

    .navbar-toggler {
        flex: 0 0 auto;
        width: 44px;
        height: 40px;
        padding: 0.35rem 0.5rem;
        border: 1px solid #dee2e6;
        border-radius: 10px;
    }

    /* Bootstrap'taki navbar-light sınıfı kullanılmadığı için
       hamburger ikonunu burada garanti ediyoruz. */
    .navbar-toggler-icon {
        background-image: var(--bs-navbar-toggler-icon-bg);
    }

    .navbar-collapse {
        width: 100%;
        background: #ffffff;
        padding: 12px;
        margin-top: 10px;
        border-radius: 15px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.10);
    }

    .navbar-nav {
        width: 100%;
        gap: 0 !important;
    }

    .navbar-nav .nav-item {
        width: 100%;
    }

    .navbar-nav .nav-link {
        display: block;
        padding: 10px 8px !important;
        border-radius: 8px;
    }

    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link:focus {
        background: #fff8e7;
    }

    #adminAuthBtn {
        width: 100%;
        margin: 6px 0 0 !important;
    }

    .navbar-collapse > .btn {
        width: 100%;
        margin: 8px 0 0 !important;
        display: block;
        text-align: center;
    }

    /* Yönetici barındaki butonlar mobilde satır değiştirebilsin. */
    #adminControlBar .container {
        align-items: stretch !important;
    }

    #adminControlBar .container > span {
        width: 100%;
    }

    #adminControlBar .container > .d-flex {
        width: 100%;
        flex-wrap: wrap;
    }

    #adminControlBar .container > .d-flex .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 768px) {
    /* Genel yatay boşlukları azalt */
    .container {
        width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }

    section.py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    /* Hero */
    .hero-section {
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
    }

    .hero-section .container {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    h1.display-4 {
        font-size: clamp(1.75rem, 8vw, 2.35rem) !important;
        line-height: 1.15;
    }

    h2,
    h2.fs-1 {
        font-size: clamp(1.45rem, 6vw, 2rem) !important;
        line-height: 1.2;
    }

    h3 {
        font-size: clamp(1.25rem, 5vw, 1.65rem);
        line-height: 1.25;
    }

    .lead {
        font-size: 1rem !important;
        line-height: 1.65;
    }

    /* CTA butonları */
    .hero-section .btn-lg,
    .btn-lg {
        width: 100%;
        max-width: 100%;
        padding: 12px 18px !important;
        font-size: 0.98rem !important;
        white-space: normal;
    }

    /* Hero görseli */
    .hero-main-img {
        display: block;
        width: 100%;
        height: auto;
        max-height: none;
        margin: 8px auto 0;
        border-width: 3px;
        border-radius: 16px;
    }

    /* Kartlar */
    .program-card {
        padding: 1.1rem !important;
        border-radius: 16px;
    }

    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        border-radius: 14px;
    }

    /* Galeri */
    .gallery-img-container {
        height: auto;
        aspect-ratio: 4 / 3;
        border-radius: 14px;
    }

    /* Accordion */
    .accordion-button {
        font-size: 0.9rem;
        line-height: 1.4;
        padding: 12px 14px;
    }

    .accordion-body {
        font-size: 0.92rem;
        line-height: 1.65;
    }

    /* Form */
    .form-card {
        padding: 20px !important;
        border-radius: 20px !important;
    }

    .custom-input {
        min-height: 46px;
        font-size: 16px; /* iOS'ta otomatik zoom'u önler */
    }

    textarea.custom-input {
        min-height: 100px;
    }

    /* Footer */
    footer {
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }

    footer .text-md-end {
        text-align: left !important;
    }
}

@media (max-width: 480px) {
    .navbar-brand {
        gap: 0.45rem !important;
    }

    .brand-logo {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .navbar-brand span {
        font-size: 0.84rem;
    }

    .navbar-toggler {
        width: 40px;
        height: 38px;
    }

    #adminControlBar .container > .d-flex .btn {
        width: 100%;
        flex-basis: 100%;
    }

    .form-card {
        padding: 16px !important;
    }

    .hero-section .badge {
        font-size: 0.78rem !important;
        white-space: normal;
    }

    .gallery-img-container {
        aspect-ratio: 1 / 1;
    }
}

/* =========================================================
   EK MOBİL DÜZELTMELERİ — 768 / 430 / 375 PX
   Metinlerin kesilmesini, taşmasını ve flex elemanlarının
   birbirini sıkıştırmasını önler.
   ========================================================= */

/* Her ekranda uzun kelime/URL/adreslerin yatay taşmasını önle. */
body,
main,
section,
footer,
.container,
.row,
[class*="col-"] {
    min-width: 0;
}

.gallery-admin-actions {
    position: absolute;
    z-index: 2;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
}

.editable-active {
    outline: 2px dashed #f6b900;
    outline-offset: 4px;
    border-radius: 4px;
    cursor: text;
}

p,
li,
label,
small,
.nav-link,
.navbar-brand span,
.accordion-button,
.accordion-body,
.card,
.card h4,
.card h5,
.card p,
.modal-title,
.modal-body,
footer p,
footer h4,
footer h5 {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Bootstrap'in grid/flex çocuklarının küçülebilmesini garanti et. */
.d-flex > *,
.row > [class*="col-"] {
    min-width: 0;
}

@media (max-width: 768px) {
    .container {
        width: 100%;
        max-width: 100%;
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .row {
        --bs-gutter-x: 1rem;
    }

    section.py-5 {
        padding-top: 2.25rem !important;
        padding-bottom: 2.25rem !important;
    }

    /* Navbar: logo, isim ve hamburger birbirini sıkıştırmasın. */
    .navbar > .container {
        display: flex;
        flex-wrap: wrap;
    }

    .navbar-brand {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        max-width: calc(100% - 52px);
        overflow: hidden;
    }

    .navbar-brand span {
        display: block;
        min-width: 0;
        max-width: 100%;
        font-size: 0.9rem !important;
        line-height: 1.18 !important;
    }

    .brand-logo {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
    }

    .navbar-toggler {
        flex: 0 0 42px;
        width: 42px;
        height: 40px;
        padding: 0.3rem;
    }

    .navbar-collapse {
        flex-basis: 100%;
        width: 100%;
    }

    /* Hero */
    .hero-section .row {
        --bs-gutter-y: 1.75rem;
    }

    .hero-section h1.display-4 {
        font-size: clamp(1.7rem, 7.8vw, 2.25rem) !important;
        line-height: 1.13 !important;
        letter-spacing: -0.02em;
    }

    .hero-section .lead {
        font-size: 0.98rem !important;
        line-height: 1.62 !important;
    }

    .hero-section .badge {
        display: inline-block;
        max-width: 100%;
        white-space: normal !important;
        line-height: 1.3;
    }

    .hero-section .btn-lg {
        display: block;
        width: 100%;
        padding: 12px 16px !important;
        white-space: normal !important;
        line-height: 1.35;
    }

    /* Bölüm başlıkları */
    section h2.fs-1,
    section h2 {
        font-size: clamp(1.4rem, 6vw, 1.95rem) !important;
        line-height: 1.18 !important;
        letter-spacing: -0.015em;
    }

    section h2 + p,
    section .text-center p.fs-5 {
        font-size: 0.94rem !important;
        line-height: 1.55 !important;
    }

    /* Eğitim kartları */
    .program-card {
        padding: 1rem !important;
        min-width: 0;
    }

    .program-card h4,
    .program-card h5 {
        min-width: 0;
        max-width: 100%;
        line-height: 1.28 !important;
    }

    .program-card p {
        line-height: 1.55 !important;
    }

    .program-card .d-flex {
        min-width: 0;
        align-items: flex-start !important;
    }

    .program-card .d-flex h5 {
        flex: 1 1 auto;
        min-width: 0;
        padding-top: 2px;
    }

    .card-icon {
        flex: 0 0 48px;
        width: 48px;
        height: 48px;
        margin-right: 0.7rem !important;
    }

    /* Vizyon + accordion */
    .accordion-button {
        display: block;
        position: relative;
        width: 100%;
        min-height: 52px;
        padding: 12px 46px 12px 14px !important;
        font-size: 0.88rem !important;
        line-height: 1.42 !important;
        white-space: normal !important;
    }

    .accordion-button::after {
        position: absolute;
        top: 50%;
        right: 14px;
        transform: translateY(-50%);
        margin: 0;
    }

    .accordion-button:not(.collapsed)::after {
        transform: translateY(-50%) rotate(-180deg);
    }

    .accordion-body {
        padding: 14px !important;
        font-size: 0.9rem !important;
        line-height: 1.62 !important;
    }

    /* Sol taraftaki tanıtım kutusu */
    .border-start.border-warning {
        overflow-wrap: break-word;
    }

    /* Galeri */
    .gallery-img-container {
        width: 100%;
        max-width: 100%;
    }

    /* Ön kayıt formu */
    .form-card {
        width: 100%;
        max-width: 100%;
        padding: 20px !important;
    }

    .form-card h3.fs-2 {
        font-size: 1.35rem !important;
        line-height: 1.22 !important;
    }

    .form-card .text-center p {
        line-height: 1.5;
    }

    .form-label {
        line-height: 1.35;
    }

    .custom-input,
    .form-select {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        font-size: 16px !important;
    }

    .form-card button[type="submit"] {
        white-space: normal !important;
        line-height: 1.35 !important;
        padding: 13px 14px !important;
    }

    /* Footer */
    footer .container {
        overflow: hidden;
    }

    footer h4 {
        font-size: 1.15rem !important;
        line-height: 1.3 !important;
    }

    footer p {
        font-size: 0.88rem !important;
        line-height: 1.58 !important;
    }

    footer .text-center {
        line-height: 1.55 !important;
    }

    /* Modallar: telefon genişliğini aşmasın. */
    .modal-dialog {
        width: auto;
        max-width: none;
        margin: 0.75rem;
    }

    .modal-content {
        max-width: 100%;
        overflow: hidden;
    }

    .modal-header,
    .modal-body {
        padding: 14px !important;
    }

    .modal-title {
        font-size: 1rem !important;
        line-height: 1.3;
        padding-right: 8px;
    }
}

/* =========================================================
   430 PX — BÜYÜK TELEFON
   ========================================================= */
@media (max-width: 430px) {
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .navbar {
        padding-top: 0.55rem !important;
        padding-bottom: 0.55rem !important;
    }

    .navbar-brand {
        max-width: calc(100% - 50px);
        gap: 0.45rem !important;
    }

    .brand-logo {
        width: 35px;
        height: 35px;
        flex-basis: 35px;
    }

    .navbar-brand span {
        font-size: 0.82rem !important;
    }

    .navbar-toggler {
        flex-basis: 40px;
        width: 40px;
        height: 38px;
    }

    .navbar-collapse {
        padding: 10px !important;
        margin-top: 8px;
    }

    .navbar-nav .nav-link {
        font-size: 0.9rem;
        line-height: 1.3;
        padding: 9px 7px !important;
    }

    .hero-section h1.display-4 {
        font-size: 1.82rem !important;
    }

    .hero-section .lead {
        font-size: 0.93rem !important;
    }

    section h2.fs-1,
    section h2 {
        font-size: 1.5rem !important;
    }

    section h2 + p,
    section .text-center p.fs-5 {
        font-size: 0.9rem !important;
    }

    .program-card {
        padding: 0.95rem !important;
    }

    .program-card h4 {
        font-size: 1.08rem !important;
    }

    .program-card h5 {
        font-size: 0.95rem !important;
    }

    .program-card p {
        font-size: 0.88rem !important;
    }

    .card-icon {
        flex-basis: 45px;
        width: 45px;
        height: 45px;
        font-size: 1.15rem;
        border-radius: 12px;
        margin-right: 0.6rem !important;
    }

    .accordion-button {
        font-size: 0.84rem !important;
        padding-left: 12px !important;
        padding-right: 42px !important;
    }

    .accordion-body {
        font-size: 0.86rem !important;
        padding: 12px !important;
    }

    .form-card {
        padding: 16px !important;
        border-radius: 18px !important;
    }

    .form-card h3.fs-2 {
        font-size: 1.22rem !important;
    }

    .form-card .fs-1 {
        font-size: 2rem !important;
    }

    .form-card button[type="submit"] {
        font-size: 0.92rem !important;
    }

    footer h4 {
        font-size: 1.05rem !important;
    }

    footer p {
        font-size: 0.84rem !important;
    }
}

/* =========================================================
   375 PX — STANDART / DAR TELEFON
   ========================================================= */
@media (max-width: 375px) {
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .row {
        --bs-gutter-x: 0.75rem;
    }

    .navbar-brand {
        max-width: calc(100% - 47px);
    }

    .brand-logo {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .navbar-brand span {
        font-size: 0.76rem !important;
        line-height: 1.12 !important;
    }

    .navbar-toggler {
        width: 38px;
        height: 36px;
        flex-basis: 38px;
    }

    .hero-section {
        border-bottom-left-radius: 16px;
        border-bottom-right-radius: 16px;
    }

    .hero-section .container {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .hero-section h1.display-4 {
        font-size: 1.62rem !important;
        line-height: 1.12 !important;
    }

    .hero-section .badge {
        font-size: 0.72rem !important;
        padding: 7px 10px !important;
    }

    .hero-section .lead {
        font-size: 0.9rem !important;
        line-height: 1.58 !important;
    }

    .hero-section .btn-lg {
        font-size: 0.9rem !important;
        padding: 11px 12px !important;
    }

    section.py-5 {
        padding-top: 1.9rem !important;
        padding-bottom: 1.9rem !important;
    }

    section h2.fs-1,
    section h2 {
        font-size: 1.35rem !important;
        line-height: 1.18 !important;
    }

    section h2 + p,
    section .text-center p.fs-5 {
        font-size: 0.86rem !important;
        line-height: 1.5 !important;
    }

    .program-card h4 {
        font-size: 1rem !important;
    }

    .program-card h5 {
        font-size: 0.9rem !important;
    }

    .program-card p {
        font-size: 0.84rem !important;
        line-height: 1.52 !important;
    }

    .card-icon {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
        font-size: 1.05rem;
        margin-right: 0.5rem !important;
    }

    .accordion-button {
        font-size: 0.8rem !important;
        line-height: 1.38 !important;
        padding: 11px 38px 11px 11px !important;
    }

    .accordion-button::after {
        right: 11px;
    }

    .accordion-body {
        font-size: 0.82rem !important;
        line-height: 1.58 !important;
    }

    .form-card {
        padding: 13px !important;
    }

    .form-card h3.fs-2 {
        font-size: 1.12rem !important;
    }

    .form-card .text-muted.small {
        font-size: 0.78rem !important;
        line-height: 1.45;
    }

    .form-label {
        font-size: 0.88rem;
    }

    .custom-input,
    .form-select {
        padding-left: 11px !important;
        padding-right: 11px !important;
    }

    .form-card button[type="submit"] {
        font-size: 0.84rem !important;
        padding: 12px 10px !important;
    }

    footer {
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
    }

    footer h4 {
        font-size: 0.98rem !important;
    }

    footer p {
        font-size: 0.8rem !important;
    }

    footer .text-center {
        font-size: 0.76rem !important;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-title {
        font-size: 0.9rem !important;
    }
}
