/* ==========================================================================
   1. ERİŞİLEBİLİRLİK VE TEMEL AYARLAR (ACCESSIBILITY & BASE)
   ========================================================================== */
body {
    background-color: #F5F0EB;
    color: #5A3E1B;
}

img {
    max-width: 100%;
    height: auto;
    content-visibility: auto;
}

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

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #1A2E1A;
    color: #D8C3A5;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #D8C3A5;
    outline-offset: 2px;
}

/* ==========================================================================
   2. ANİMASYONLAR VE KEYFRAMES
   ========================================================================== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* ==========================================================================
   3. GENEL BİLEŞENLER (SCROLLBAR, BUTTONS, PRELOADER)
   ========================================================================== */
.custom-scrollbar::-webkit-scrollbar,
#modal-body::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb,
#modal-body::-webkit-scrollbar-thumb {
    background-color: #D8C3A5;
    border-radius: 10px;
}

.btn-custom {
    position: relative;
    z-index: 1;
    overflow: hidden;
    transition: color 0.4s ease-in-out;
}

.btn-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: #2F4F2F;
    transition: width 0.4s ease-in-out;
    z-index: -1;
}

.btn-custom:hover::before {
    width: 100%;
}

.btn-custom:hover {
    border-color: transparent;
}

#preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #1a2e1a;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-content { text-align: center; }
.preloader-logo {
    width: 200px;
    height: auto;
    animation: pulse 2s ease-in-out infinite;
    filter: brightness(0) invert(1);
}

.preloader-text {
    color: #d4c5b0;
    font-size: 12px;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 20px;
    opacity: 0.8;
}

/* ==========================================================================
   4. NAVİGASYON VE HERO (HEADER)
   ========================================================================== */
#navbar {
    transition: all 0.5s ease-in-out;
}

#navbar.scrolled {
    background-color: rgba(26, 46, 26, 0.98);
    padding-top: 1rem;
    padding-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

#navbar.scrolled .nav-link {
    font-weight: 400;
}

#hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.video-overlay {
    background-color: rgba(0, 0, 0, 0.25);
}

#mobile-menu {
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

/* ==========================================================================
   5. TAKIM VE GRID SİSTEMİ (TEAM SECTION)
   ========================================================================== */
#teamGrid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
    position: relative;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.team-card-wrapper {
    position: relative;
    height: 500px;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center center;
}

.team-card-closed {
    position: absolute;
    inset: 0;
    background: transparent;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
    cursor: pointer;
}

.team-img {
    filter: grayscale(100%);
    transition: filter 0.6s ease, transform 0.6s ease;
}

.team-card:hover .team-img {
    filter: grayscale(0%);
    transform: scale(1.03);
}

/* Aktif Kart Durumu */
.team-card-wrapper.is-active {
    grid-column: 1 / -1;
    grid-row: 1 / 2;
    height: 600px;
    z-index: 20;
}

.team-card-wrapper.is-active .team-card-closed {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

.team-card-open {
    position: absolute;
    inset: 0;
    background: white;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 4px;
}

.team-card-wrapper.is-active .team-card-open {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

/* Kart İçerik Detayları */
.team-card-open .content-section {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.team-card-wrapper.is-active .team-card-open .content-section {
    opacity: 1;
    transform: translateY(0);
}

.team-card-wrapper.is-active .team-card-open .content-section:nth-child(1) { transition-delay: 0.2s; }
.team-card-wrapper.is-active .team-card-open .content-section:nth-child(2) { transition-delay: 0.3s; }
.team-card-wrapper.is-active .team-card-open .content-section:nth-child(3) { transition-delay: 0.4s; }
.team-card-wrapper.is-active .team-card-open .content-section:nth-child(4) { transition-delay: 0.5s; }

#teamGrid.has-active-card .team-card-wrapper:not(.is-active) {
    opacity: 0.4;
    transform: scale(0.95);
    pointer-events: none;
}

.close-btn {
    opacity: 0;
    transform: rotate(-90deg) scale(0.8);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.team-card-wrapper.is-active .close-btn {
    opacity: 1;
    transform: rotate(0) scale(1);
    transition-delay: 0.3s;
}

.close-btn:hover { transform: rotate(90deg) scale(1.1); }

.photo-container {
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.team-card-wrapper.is-active .photo-container {
    transform: scale(1);
    opacity: 1;
    transition-delay: 0.2s;
}

/* Takım Responsive Ayarları */
@media (max-width: 1024px) {
    #teamGrid { grid-template-columns: repeat(2, 1fr); }
    .team-card-wrapper.is-active { height: 700px; }
}

@media (max-width: 768px) {
    #teamGrid { grid-template-columns: 1fr; }
    .team-card-wrapper.is-active {
        position: fixed;
        inset: 0;
        height: 100vh;
        width: 100vw;
        z-index: 9999;
        border-radius: 0;
    }
    .team-card-wrapper.is-active .team-card-open { border-radius: 0; }
}

/* ==========================================================================
   6. FORM VE INPUT DURUMLARI
   ========================================================================== */
.char-counter { transition: all 0.3s ease; }
.char-counter.warning { color: #fbbf24 !important; }
.char-counter.danger { color: #f87171 !important; font-weight: 600; }
.char-counter.valid { color: #34d399 !important; }

.input-error {
    border-color: #f87171 !important;
    background-color: rgba(248, 113, 113, 0.05) !important;
}

.input-success { border-color: #34d399 !important; }
.input-focused { border-color: #D8C3A5 !important; }

/* ==========================================================================
   7. COOKIE BANNER VE AYAR MODALI
   ========================================================================== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 46, 26, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(216, 195, 165, 0.2);
    z-index: 9998;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 1.5rem 0;
}

.cookie-banner.show { transform: translateY(0); }

.cookie-banner-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.cookie-text {
    color: #F5F0EB;
    font-size: 0.875rem;
    line-height: 1.6;
    flex: 1;
}

.cookie-text strong {
    color: #D8C3A5;
    display: block;
    margin-bottom: 0.25rem;
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.cookie-btn-accept { background: #D8C3A5; color: #1A2E1A; }
.cookie-btn-accept:hover { background: #F5F0EB; }
.cookie-btn-settings { background: transparent; color: #D8C3A5; border: 1px solid #D8C3A5; }
.cookie-btn-settings:hover { background: rgba(216, 195, 165, 0.1); }
.cookie-btn-reject {
    background: transparent;
    color: rgba(245, 240, 235, 0.6);
    border: 1px solid rgba(245, 240, 235, 0.3);
    font-size: 0.7rem;
    padding: 0.5rem 1rem;
}

/* Cookie Settings Modal */
.cookie-settings-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cookie-settings-modal.show { display: flex; opacity: 1; }

.cookie-settings-content {
    background: #F5F0EB;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 1px solid rgba(90, 62, 27, 0.1);
}

.cookie-settings-modal.show .cookie-settings-content { transform: scale(1); }

.cookie-settings-header {
    background: #1A2E1A;
    color: white;
    padding: 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.cookie-settings-header h3 { font-family: 'Playfair Display', serif; font-size: 1.75rem; margin-bottom: 0.5rem; }
.cookie-settings-header p { color: rgba(216, 195, 165, 0.8); font-size: 0.875rem; }

.cookie-settings-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #D8C3A5;
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cookie-settings-close:hover { color: white; transform: rotate(90deg); }

.cookie-settings-body { padding: 2rem; }

.cookie-category {
    border-bottom: 1px solid rgba(90, 62, 27, 0.1);
    padding: 1.5rem 0;
}

.cookie-category:last-child { border-bottom: none; }

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.cookie-category-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: #1A2E1A;
    font-weight: 600;
}

.cookie-toggle {
    position: relative;
    width: 48px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.cookie-toggle.active { background: #2F4F2F; }
.cookie-toggle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.cookie-toggle.active::after { transform: translateX(24px); }
.cookie-toggle.disabled { opacity: 0.5; cursor: not-allowed; }

.cookie-category-desc {
    color: #5A3E1B;
    font-size: 0.875rem;
    line-height: 1.6;
    opacity: 0.8;
}

.cookie-settings-footer {
    padding: 1.5rem 2rem;
    background: rgba(26, 46, 26, 0.05);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    border-top: 1px solid rgba(90, 62, 27, 0.1);
}

@media (max-width: 768px) {
    .cookie-banner-content { flex-direction: column; text-align: center; padding: 0 1rem; }
    .cookie-buttons { width: 100%; justify-content: center; flex-wrap: wrap; }
    .cookie-settings-content { width: 95%; max-height: 95vh; }
}

/* ==========================================================================
   8. YAZICI ÇIKTISI AYARLARI (PRINT STYLES)
   ========================================================================== */
@media print {
    #navbar,
    #mobile-menu,
    #preloader,
    .video-overlay,
    #contactForm,
    .btn-custom,
    .close-btn {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}