/* Modern Overrides */
* {
    box-sizing: border-box;
}

body {
    background-color: #e5e0d8; 
    background: radial-gradient(circle at center top, #f2efe9 0%, #dcd5ca 100%); /* City memory gradient background */
    background-attachment: fixed;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animations Awwwards Style */
@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    0% { opacity: 0; transform: translateY(-30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    0% { opacity: 0; transform: translateX(-30px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* Base Body Reveal */
body:not(.page-loaded) {
    opacity: 0;
}
body.page-loaded {
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

/* 
   Col-based Responsive Layout System 
   Instead of destroying all tables via wildcard td { display: block }, 
   we selectively build a framework on main structural tables. 
*/

/* Main wrapper - Targeted Safely ONLY to the top content area */
body > table > tbody > tr > td[align="center"]:not([valign="top"]) > table[width="1000"] {
    max-width: 1200px !important;
    width: 100% !important;
    margin: 0 auto !important;
    background-color: #ffffff !important;
    border-radius: 0 !important; /* Restored classic museum frame */
    table-layout: fixed; /* Prevent cell content from forcing horizontal scroll */
    border: 8px solid #4a3e35 !important; /* Restored thick historical frame */
    
    /* The Magical Spreading Gradient: Emits the frame color outwards beautifully into the background */
    box-shadow: 0 0 100px 10px rgba(74, 62, 53, 0.45) !important;
    position: relative;
    box-sizing: border-box;
}

/* Breakout fullscreen footer layout with background aura */
td[valign="top"] > table[width="1000"] {
    border: none !important;
    table-layout: auto !important;
    
    /* 100vw Breakout trick */
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    
    /* Elegant top/bottom transition shadow requested by user */
    box-shadow: 0 -20px 40px rgba(74, 62, 53, 0.08), 0 20px 40px rgba(74, 62, 53, 0.08) !important;
    
    margin-top: 20px !important;
    padding-top: 50px !important;
    padding-bottom: 40px !important;
    
    background: linear-gradient(to top, rgba(230,225,216,1) 0%, rgba(230,225,216,0.6) 80%, rgba(255,255,255,0) 100%) !important;
    position: relative;
    border-radius: 0 !important;
}

/* Ensure the content inside the stretched footer remains centered safely */
td[valign="top"] > table[width="1000"] > tbody > tr > td > table[width="100%"] {
    max-width: 1200px !important;
    margin: 0 auto !important;
    display: table !important; /* Fixed table squishing */
    width: 100% !important;
}

/* Content layout wrapper */
table[width="980"] {
    max-width: 100% !important;
    width: 100% !important;
    background: transparent;
    display: block !important;
    box-sizing: border-box !important;
}

table[width="980"] > tbody {
    display: block !important;
    width: 100% !important;
}

table[width="980"] > tbody > tr {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 20px !important;
}

/* Mobile First: Sidebar and Content take 100% width (Col-12) */
table[width="980"] > tbody > tr > td[width="180"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    display: block !important;
    margin-bottom: 30px !important;
    position: relative !important;
    z-index: 50 !important; /* Sidebar must be above content to prevent hover disappear */
}

table[width="980"] > tbody > tr > td[width="700"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    display: block !important;
    animation: fadeInUp 0.8s ease-out 0.4s both;
    position: relative !important;
    z-index: 10 !important;
}

/* Desktop Layout (Col-3 / Col-9 equivalent) */
@media (min-width: 900px) {
    table[width="980"] > tbody > tr {
        flex-wrap: nowrap !important;
    }
    table[width="980"] > tbody > tr > td[width="180"] {
        flex: 0 0 250px !important;
        max-width: 250px !important;
        margin-bottom: 0 !important;
    }
    table[width="980"] > tbody > tr > td[width="700"] {
        flex: 1 !important;
        max-width: calc(100% - 250px) !important;
        padding-left: 40px !important;
    }
}

/* Inner Layout fixes for tables inside the content (e.g. 3-column flags/footer) */
td[width="700"] table {
    width: 100% !important;
    max-width: 100% !important;
}

@media (max-width: 768px) {
    /* Make interior content tables stack gracefully */
    td[width="700"] table[width="100%"] > tbody > tr {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    td[width="700"] table[width="100%"] > tbody > tr > td {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
    }
    /* Logo Footer Table Mobile Fix */
    table[bgcolor="#FFFFFF"] > tbody > tr:nth-child(3) {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    table[bgcolor="#FFFFFF"] > tbody > tr:nth-child(3) > td {
        display: block;
        width: 100%;
        text-align: center;
    }
}

/* Hardcoded price container override */
#kent-bellegi-fiyat-container {
    width: 100% !important;
    max-width: 980px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    padding: 0 15px;
    margin: 40px auto !important;
    animation: fadeInUp 1s ease-out 0.3s both;
}
#kent-bellegi-fiyat-container > div {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    border: 2px dashed #dcdcdc !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05) !important;
    border-radius: 8px !important;
    transition: transform 0.4s ease;
}
#kent-bellegi-fiyat-container > div:hover {
    transform: translateY(-5px);
    border-color: #4a3e35 !important;
}
#kent-fiyat-metni {
    font-size: clamp(16px, 4vw, 24px) !important; 
    color: #4a3e35 !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    display: block !important;
}

/* 
===============================================
Original Tabs Restored natively via CSS
=============================================== 
*/
.top-tabs-container {
    display: flex;
    justify-content: center;
    background: transparent;
    padding-top: 15px;
    margin-bottom: 0;
    position: relative;
    z-index: 10;
}

.custom-tab {
    background: #4a3e35;
    color: #ffffff;
    padding: 10px 45px;
    font-size: 14px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    text-decoration: none;
    position: relative;
    border-radius: 4px 4px 0 0;
    margin: 0 20px;
    display: inline-block;
    letter-spacing: 0.5px;
    transition: background 0.3s ease;
}

/* Creating the classic slanted edge */
.custom-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -20px;
    width: 40px;
    height: 100%;
    background: #4a3e35;
    transform: skewX(-35deg);
    border-radius: 4px 0 0 0;
    z-index: -1;
    transition: background 0.3s ease;
}

.custom-tab::after {
    content: '';
    position: absolute;
    top: 0;
    right: -20px;
    width: 40px;
    height: 100%;
    background: #4a3e35;
    transform: skewX(35deg);
    border-radius: 0 4px 0 0;
    z-index: -1;
    transition: background 0.3s ease;
}

.custom-tab:hover, .custom-tab:hover::before, .custom-tab:hover::after {
    background: #736357;
    color: #ffd700;
}

/* Decorative box between tabs */
.tab-separator {
    width: 20px;
    height: 25px;
    background: #8b795e;
    align-self: flex-end;
    margin-bottom: 0px;
    border: 1px solid #705f47;
}

/* Slider CSS */
.modern-slider {
    position: relative;
    width: 100%;
    height: 480px; /* Taller, more impactful */
    background: #000;
    overflow: hidden;
}

.modern-slider .slides {
    width: 100%;
    height: 100%;
    position: relative;
}

.modern-slider .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-slider .slide.active {
    opacity: 1;
}

.modern-slider .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Enhanced Slider Controls */
.slider-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 30px;
    pointer-events: none;
    z-index: 20;
}

.slider-controls span {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.4);
    transition: all 0.3s ease;
}

.slider-controls span:hover {
    background: #ffffff;
    color: #1e3c72;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Sidebar modern styles */
.sidebarmenu {
    background: #ffffff;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    animation: slideInRight 0.8s ease-out 0.2s both;
    position: relative;
}

.sidebarmenu ul {
    border: none !important;
    width: 100% !important;
}

.sidebarmenu ul li a {
    color: #4b5563 !important;
    background-color: transparent !important;
    border: none !important;
    border-bottom: 1px solid #f8fafc !important;
    padding: 18px 20px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    position: relative;
    display: block !important;
}

.sidebarmenu ul li a:hover {
    background-color: #f1f5f9 !important;
    color: #1e3c72 !important;
    padding-left: 26px !important;
}

.sidebarmenu ul li ul {
    background: #ffffff !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1) !important;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    z-index: 100;
    width: 240px !important;
    overflow: visible !important; /* Fixed clipping so third-level menus can open */
}

/* Base submenu inner text */
.sidebarmenu ul li ul li a {
    font-size: 14px !important;
    padding: 14px 20px !important;
}

/* Main content text styling */
td[width="700"] p, .text, .LN_TEXT {
    font-size: 16px !important;
    line-height: 1.8 !important;
    color: #374151 !important;
}

td[width="700"] strong {
    color: #111827 !important;
}

/* Remove old structural images */
img[src*="anaimg/index_r"] {
    display: none !important;
}

hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 30px 0;
}

/* Main Content Responsive Wrapper Cleanup */
table[width="1000"] {
    position: relative;
}

td[height="2"][bgcolor="#453d35"] {
    background-color: transparent !important; /* Replaced legacy hardline with soft elegant border */
    border-top: 1px solid rgba(74, 62, 53, 0.15);
    height: 1px !important;
}

/* Typography modernizations */
h3, h2, h1, .baslik {
    color: #4a3e35 !important;
    font-family: 'Inter', sans-serif !important;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 8px; /* Slight rounding for modern feel */
}

/* Header Responsive Fix */
@media (max-width: 768px) {
    .top-tabs-container {
        flex-direction: row;
        justify-content: center;
        gap: 15px;
        padding-top: 15px;
        padding-bottom: 10px;
    }
    
    .custom-tab {
        border-radius: 6px;
        margin: 0;
        text-align: center;
        padding: 10px 30px;
    }
    .custom-tab::before, .custom-tab::after {
        display: none; /* remove slants on mobile */
    }
    .tab-separator {
        display: none;
    }
    
    .modern-slider {
        height: 250px;
        border-width: 4px; /* smaller border on mobile */
    }
    
    table[width="1000"] {
        border-width: 4px;
        border-radius: 0;
        box-shadow: none;
    }
    
    /* Footer Logos Grid row - Safe version without :has() */
    td[valign="top"] table[width="1000"] table[width="100%"] > tbody > tr:nth-child(3) {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: space-evenly !important; /* Perfect gap spread */
        align-items: center !important;
        gap: 30px 10px !important; /* Vertical and horizontal breathing room */
        padding: 20px 10px !important;
    }
    td[valign="top"] table[width="1000"] table[width="100%"] > tbody > tr:nth-child(3) > td {
        display: flex !important;
        justify-content: center !important;
        width: 45% !important; /* Crisp 2x2 side-by-side grid */
    }
    td[valign="top"] table[width="1000"] table[width="100%"] > tbody > tr:nth-child(3) > td img {
        max-width: 100% !important;
        height: auto !important;
        object-fit: contain;
    }
}

/* Mobile Sidebar Menu Accordion */
@media (max-width: 900px) {
    .sidebarmenu {
        height: 55px;
        overflow: hidden;
        position: relative;
        background: #4a3e35;
        cursor: pointer;
        transition: height 0.4s ease;
        border-radius: 8px;
    }
    .sidebarmenu::before {
        content: '\2630  MEN\00DCY\00DC  A\00C7 / KAPAT';
        display: flex;
        align-items: center;
        justify-content: center;
        height: 55px;
        color: #ffffff;
        font-weight: 700;
        font-size: 14px;
        letter-spacing: 1px;
    }
    .sidebarmenu.open {
        height: auto;
        background: #ffffff;
        overflow: visible;
        padding-top: 55px;
    }
    .sidebarmenu.open::before {
        content: '\2715  MEN\00DCY\00DC  KAPAT';
        position: absolute;
        top: 0; left: 0; width: 100%;
        background: #b0413e;
        color: #fff;
    }
    .sidebarmenu ul {
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .sidebarmenu.open ul {
        opacity: 1;
    }

    /* Mobile Accordion Submenu Fix - Prevent flying out to the right */
    .sidebarmenu ul li ul {
        position: static !important; /* Dropdown becomes vertical pushdown */
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        border-left: 4px solid #b0413e !important;
        margin-left: 0 !important;
        background: #f8fafc !important; /* Indentation feel */
        box-sizing: border-box;
    }
    .sidebarmenu ul li ul li a {
        padding-left: 30px !important;
        background: transparent !important;
        border-bottom: 1px dashed #e2e8f0 !important;
    }
} /* Close the @media (max-width: 900px) properly ! */

/* Clean up ugly legacy map tables in iletisim.php */
table[border="5"] {
    border: 1px solid rgba(0,0,0,0.08) !important; /* Strip the original ugly 3D frame */
    width: 170px !important; /* Extremely strict boundary */
    max-width: 170px !important;
    display: block !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06) !important;
    border-radius: 12px;
    overflow: hidden !important;
    margin: 0 30px 20px 0 !important;
    float: left;
    background: transparent !important;
}
table[border="5"] tbody, table[border="5"] tr, table[border="5"] td {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
}
table[border="5"] a {
    display: block !important;
    width: 100% !important;
}
table[border="5"] img {
    border-radius: 12px;
    display: block !important;
    width: 100% !important;
    height: auto !important;
}
