:root {
    --bg-color: #050b14; /* Deep dark blue background */
    --surface-color: #0b1528; /* Slightly lighter blue panel */
    --primary: #e63946; /* Vibrant Red */
    --primary-hover: #ff4d4d; /* Brighter Red for hover */
    --accent: #457b9d; /* Soft Blue accent */
    --accent-glow: rgba(230, 57, 70, 0.4);
    --text-main: #f8f9fa;
    --text-muted: #a8b2d1;
    --danger: #ef233c;
    --border: rgba(69, 123, 157, 0.2); /* Blue border tint */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    background-image: radial-gradient(circle at 15% 50%, rgba(230, 57, 70, 0.08), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(69, 123, 157, 0.1), transparent 25%);
    overflow-x: hidden;
    width: 100%;
}
html { overflow-x: hidden; }

a {
    text-decoration: none;
    color: var(--text-main);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Glassmorphism Panel */
.glass-panel {
    background: rgba(11, 21, 40, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Navbar */
.navbar {
    background: #030303;
    backdrop-filter: none;
    position: sticky;
    top: 0;
    z-index: 999999 !important;
    border-bottom: 1px solid #1a1a1a;
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    min-height: 100px;
}
.logo {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo-icon { 
    color: var(--primary); 
    font-size: 1.8rem;
    text-shadow: 0 0 15px var(--accent-glow);
}
.logo-light { font-weight: 300; color: var(--accent); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    text-align: center;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    position: relative;
    z-index: 1 !important;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #d90429);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--text-main);
}
.btn-outline:hover {
    background: rgba(69, 123, 157, 0.2);
    border-color: var(--text-main);
}
.btn-delete {
    background-color: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}
.btn-delete:hover {
    background-color: var(--danger);
    color: white;
}
.btn-search {
    background: linear-gradient(135deg, var(--primary), #d90429);
    color: white;
    padding: 15px 30px;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* Hero Section */
.hero {
    padding: 100px 20px;
    text-align: center;
    background: linear-gradient(180deg, rgba(5,11,20,1) 0%, rgba(11,21,40,0.8) 100%);
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(230, 57, 70, 0.05), transparent 60%);
    z-index: 0;
}
.hero-content {
    position: relative;
    z-index: 1;
}
.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 800;
    line-height: 1.2;
    background: linear-gradient(to right, #ffffff, #a8b2d1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-bottom: 50px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Panel Focus Effects */
.hero select:focus,
.hero input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.15), inset 0 0 10px rgba(230, 57, 70, 0.05) !important;
}
.hero select:hover,
.hero input[type="text"]:hover,
.hero input[type="number"]:hover {
    border-color: rgba(69,123,157,0.5) !important;
}

/* Number input spinners temizle */
.hero input[type="number"]::-webkit-inner-spin-button,
.hero input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.hero input[type="number"] { -moz-appearance: textfield; }

@media (max-width: 768px) {
    .hero form > div > div:first-child { flex-direction: column !important; }
    .hero form > div > div:last-child { grid-template-columns: 1fr 1fr !important; }
}

/* Showcase Grid */
.section-title {
    margin: 80px 0 40px;
    font-weight: 800;
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    gap: 15px;
}
.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--primary), transparent);
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 35px;
    margin-bottom: 100px;
}
.card {
    background: rgba(11, 21, 40, 0.6);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
}
.card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 15px 30px rgba(0,0,0,0.4), 0 0 20px rgba(230, 57, 70, 0.2);
}
.card-image {
    position: relative;
    height: 240px;
    background: #000;
    overflow: hidden;
}
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: all 0.5s ease;
}
.card:hover .card-image img { 
    opacity: 1; 
    transform: scale(1.05);
}
.card-price {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary), #d90429);
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px var(--accent-glow);
}
.card-content { padding: 25px; }
.card-location {
    color: var(--accent);
    font-size: 0.95rem;
    margin-bottom: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}
.card h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-features {
    display: flex;
    gap: 25px;
    color: var(--text-muted);
    font-size: 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 15px;
}

/* Detail Page */
.detail-page { padding: 50px 20px; }
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
}
.detail-header h1 {
    font-size: 2rem;
    font-weight: 800;
}
.detail-price {
    font-size: 2.5rem;
    color: var(--primary);
    font-weight: 800;
    text-shadow: 0 0 20px var(--accent-glow);
}
.detail-location { color: var(--accent); margin-bottom: 30px; font-size: 1.2rem; font-weight: 600; }
.gallery { margin-bottom: 50px; }
.main-image {
    height: 550px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}
.main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
    cursor: zoom-in;
}
.thumbnail-list {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
}
.thumbnail-list::-webkit-scrollbar { height: 8px; }
.thumbnail-list::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }
.thumbnail-list::-webkit-scrollbar-track { background: var(--surface-color); border-radius: 10px; }
.thumb {
    width: 140px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.5;
    transition: all 0.3s ease;
}
.thumb:hover { opacity: 1; border-color: var(--primary); transform: translateY(-3px); }
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    margin-bottom: 50px;
}
.detail-features-box, .detail-description, .contact-box { padding: 40px; }
.detail-features-box h3, .detail-description h3, .contact-box h3 {
    margin-bottom: 25px;
    color: var(--primary);
    font-size: 1.5rem;
}
.detail-features-box ul { list-style: none; }
.detail-features-box li {
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
}

/* Forms & Admin */
.form-group { margin-bottom: 25px; }
.form-row { display: flex; gap: 25px; }
.half { flex: 1; }
label { display: block; margin-bottom: 10px; color: var(--accent); font-weight: 600; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px;}
.form-control {
    width: 100%;
    padding: 15px 20px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    color: white;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}
.form-control:focus { 
    border-color: var(--primary); 
    background: rgba(0,0,0,0.5);
    box-shadow: 0 0 15px rgba(230, 57, 70, 0.1);
}
.full-width { width: 100%; }

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 50px 0;
}
.admin-header h2 { font-size: 2rem; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th, .admin-table td {
    padding: 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.admin-table th { color: var(--accent); font-weight: 600; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px;}
.table-img { width: 100px; height: 60px; object-fit: cover; border-radius: 6px; }
.no-img-sm { width: 100px; height: 60px; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; border-radius: 6px; }

/* Flash Messages */
.flash-messages { margin-top: 20px; }
.flash { padding: 15px 20px; border-radius: 8px; margin-bottom: 10px; font-weight: 600; display: flex; align-items: center; gap: 10px;}
.flash.success { background: rgba(46, 204, 113, 0.15); border: 1px solid #2ecc71; color: #2ecc71; }
.flash.error { background: rgba(231, 76, 60, 0.15); border: 1px solid #e74c3c; color: #e74c3c; }

footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
    margin-top: 80px;
    background: rgba(5, 11, 20, 0.9);
}

    /* Bottom Navigation Bar */
    .bottom-nav { display: none; }

@media (max-width: 768px) {
    .detail-grid { grid-template-columns: 1fr !important; }
    .form-row { flex-direction: column !important; gap: 0 !important; }
    .hero h1 { font-size: 2.2rem !important; }
    .card-image { height: 200px !important; }
    
    /* Native App Mobile Layout */
    body { padding-bottom: 60px !important; }
    .nav-links { display: flex !important; gap: 0 !important; }
    .nav-links > a[href] { display: none !important; } /* Sadece metin linklerini gizle, dropdown ve dil seçiciyi bırak */
    .nav-container { padding: 10px 15px !important; flex-direction: row !important; justify-content: space-between !important; min-height: 60px !important; }
    .logo img { height: 45px !important; max-width: 55vw; object-fit: contain; }
    .detail-header h1 { font-size: 1.3rem !important; font-weight: 700 !important; }
    .detail-header { flex-direction: column !important; align-items: flex-start !important; gap: 5px !important; }
    .detail-price { font-size: 1.5rem !important; }
    .detail-location { font-size: 0.9rem !important; }
    footer { display: block !important; padding-bottom: 80px !important; } /* Alt menünün altında kalmaması için */
    
    .bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0; left: 0; width: 100%;
        background: rgba(5, 11, 20, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid rgba(69, 123, 157, 0.3);
        z-index: 999999;
        justify-content: space-around;
        padding: 8px 0 10px 0;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    }
    .bottom-nav-item {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        color: var(--text-muted); font-size: 0.65rem; text-transform: uppercase; font-weight: 600; text-decoration: none;
        gap: 3px;
    }
    .bottom-nav-item.active { color: var(--gold, #ffb703); }
    .bottom-nav-item svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
    .bottom-nav-item.active svg { stroke-width: 2.5; }
    
    /* About Us Fixes */
    .about-grid { grid-template-columns: 1fr !important; gap: 20px !important; }
    .values-grid { grid-template-columns: 1fr 1fr !important; gap: 15px !important; }
    .glass-panel { padding: 20px !important; }
    
    /* Mobile Admin & Form Fixes */
    .form-group.third, .form-group.half { width: 100% !important; max-width: 100% !important; flex: none !important; }
    #features_grid { grid-template-columns: 1fr 1fr !important; }
    .admin-header { flex-direction: column; align-items: flex-start; gap: 15px; margin: 25px 0; }
    .admin-header h2 { font-size: 1.5rem; }
    .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
    .container { padding-left: 15px; padding-right: 15px; }
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}
.lightbox.active {
    display: flex;
}
.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    transition: color 0.3s;
}
.lightbox-close:hover {
    color: var(--primary);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
    padding-bottom: 20px; /* Fare asagi inince menu kapanmasin diye tampon bolge */
    margin-bottom: -20px;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #0b1528 !important;
    min-width: 250px;
    box-shadow: 0px 8px 32px rgba(0,0,0,0.9);
    border-radius: 12px;
    z-index: 9999999 !important;
    overflow: hidden;
    border: 1px solid #1e3a5f;
}

.dropdown:hover .dropdown-content {
    display: block;
}
.show-dropdown {
    display: block !important;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.dropdown-content a:hover {
    background-color: rgba(255,255,255,0.08);
    color: var(--primary);
    padding-left: 25px;
}

.dropdown-header {
    display: block;
    padding: 15px 20px 5px 20px;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 8px 0;
}

/* Print CSS */
@media print {
    body, html {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }
    /* Hide everything that is not the printable area */
    nav, .navbar, footer, .btn, form, #doc-form, 
    .bottom-nav, #chatbot-container, #cookie-banner,
    .container > div:first-child, /* The header with title and buttons */
    .container > div:nth-child(2) > div:first-child /* The input panel */ {
        display: none !important;
    }
    
    /* Reset container and grid layouts so printable area takes full width */
    .container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .container > div {
        display: block !important; /* Overrides the grid */
    }
    
    /* Printable area natural flow */
    #printable-a4 {
        width: 100% !important;
        max-width: 210mm !important;
        margin: 0 auto !important;
        box-shadow: none !important;
        border: none !important;
        min-height: auto !important;
        height: auto !important;
        overflow: visible !important;
        page-break-after: auto;
    }
    
    /* Remove outer dark background */
    #printable-a4 {
        padding-top: 10mm !important; /* Add some top padding for print */
    }
    .container > div:nth-child(2) > div:nth-child(2) {
        background: white !important;
        padding: 0 !important;
    }

    @page {
        margin: 12mm 0;
        size: A4;
    }
}

/* ========================================================================= */
/* ARABIC TEXT MODE (Right-to-Left text alignment without flipping layout) */
/* ========================================================================= */
.ar-text-mode [data-translatable],
.ar-text-mode [data-i18n],
.ar-text-mode .portal-title,
.ar-text-mode .detail-description,
.ar-text-mode p, 
.ar-text-mode h1, .ar-text-mode h2, .ar-text-mode h3, .ar-text-mode h4, .ar-text-mode h5, .ar-text-mode h6 {
    text-align: right !important;
    direction: rtl !important;
}

/* Specific overrides to keep structure intact if needed */
.ar-text-mode .detail-location span {
    direction: ltr !important;
}
