/* ========================================
   Emlak Portalı - Frontend CSS
   Responsive, Flexbox/Grid tabanlı
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #f59e0b;
    --primary-dark: #d97706;
    --primary-light: #fbbf24;
    --secondary: #1e293b;
    --secondary-dark: #0f172a;
    --text: #334155;
    --text-light: #64748b;
    --text-lighter: #94a3b8;
    --white: #ffffff;
    --bg: #f8fafc;
    --bg-light: #f1f5f9;
    --border: #e2e8f0;
    --success: #22c55e;
    --danger: #ef4444;
    --info: #3b82f6;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    overflow-x: hidden;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

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

/* --- Top Bar --- */
.topbar {
    background: var(--secondary-dark);
    color: var(--white);
    font-size: 0.85rem;
    padding: 0.5rem 0;
}

.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-left a {
    color: var(--text-lighter);
}

.topbar-left a:hover {
    color: var(--primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.social-links {
    display: flex;
    gap: 0.5rem;
}

.social-links a {
    color: var(--text-lighter);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    font-size: 0.75rem;
}

.social-links a:hover {
    background: var(--primary);
    color: var(--white);
}

.lang-switch {
    display: flex;
    gap: 0.25rem;
}

.lang-switch a {
    color: var(--text-lighter);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.lang-switch a:hover,
.lang-switch a.active {
    color: var(--primary);
    background: rgba(255,255,255,0.1);
}

/* --- Header --- */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
}

.logo span {
    color: var(--primary);
}

.logo img {
    height: 40px;
}

/* --- Navbar --- */
.navbar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--text);
    font-weight: 500;
    border-radius: var(--radius);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

/* Megamenu */
.has-megamenu {
    position: static;
}

.megamenu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    display: none;
    z-index: 200;
    border-top: 3px solid var(--primary);
}

.has-megamenu:hover .megamenu {
    display: block;
}

.megamenu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.megamenu-col h4 {
    font-size: 1rem;
    color: var(--secondary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.megamenu-col a {
    display: block;
    padding: 0.35rem 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.megamenu-col a:hover {
    color: var(--primary);
    padding-left: 0.5rem;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary);
    padding: 0.5rem;
}

/* --- Hero Section --- */
.hero {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--white);
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.hero h1 span {
    color: var(--primary);
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-lighter);
    margin-bottom: 2rem;
}

/* --- Search Box --- */
.search-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    margin: 0 auto;
}

.search-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-tab {
    padding: 0.5rem 1.5rem;
    border: none;
    background: var(--bg-light);
    color: var(--text);
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.search-tab.active,
.search-tab:hover {
    background: var(--primary);
    color: var(--white);
}

.search-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.search-form .form-group {
    margin-bottom: 0;
}

.search-form input,
.search-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-form input:focus,
.search-form select:focus {
    outline: none;
    border-color: var(--primary);
}

.search-form .btn-search {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    grid-column: span 1;
}

.search-form .btn-search:hover {
    background: var(--primary-dark);
}

/* --- Section Titles --- */
.section {
    padding: 3rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.75rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.section-header h2 span {
    color: var(--primary);
}

.section-header p {
    color: var(--text-light);
}

.section-header::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary);
    margin: 1rem auto 0;
}

/* --- Acil Vitrin --- */
.urgent-listings {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

/* --- Listing Cards --- */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.listing-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.listing-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.listing-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.listing-card:hover .listing-card-image img {
    transform: scale(1.05);
}

.listing-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--white);
}

.badge-sale {
    background: var(--info);
}

.badge-rent {
    background: var(--success);
}

.badge-urgent {
    background: var(--danger);
}

.badge-vitrin {
    background: var(--primary);
}

.listing-card-favorite {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.listing-card-favorite:hover {
    background: var(--danger);
    color: var(--white);
}

.listing-card-body {
    padding: 1rem;
}

.listing-card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.listing-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listing-card-location {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.listing-card-features {
    display: flex;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-light);
}

.listing-card-features span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* --- Footer --- */
.footer {
    background: var(--secondary);
    color: var(--white);
    padding-top: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding-bottom: 2rem;
}

.footer-col h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.footer-col p {
    color: var(--text-lighter);
    font-size: 0.9rem;
    line-height: 1.7;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a {
    color: var(--text-lighter);
    font-size: 0.9rem;
}

.footer-col ul li a:hover {
    color: var(--primary);
    padding-left: 0.25rem;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-lighter);
    font-size: 0.9rem;
}

.footer-contact li span {
    color: var(--primary);
    min-width: 20px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-lighter);
    font-size: 0.85rem;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

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

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

.btn-secondary:hover {
    background: var(--secondary-dark);
}

/* --- Alerts --- */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-link {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    transition: var(--transition);
}

.page-link:hover,
.page-link.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .megamenu-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .search-form {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .topbar .container {
        justify-content: center;
        text-align: center;
    }

    .menu-toggle {
        display: block;
    }

    .navbar {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        z-index: 200;
    }

    .navbar.active {
        display: flex;
    }

    .nav-link {
        width: 100%;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--border);
    }

    .megamenu {
        position: static;
        box-shadow: none;
        border-top: none;
        padding: 0.5rem 0 0.5rem 1rem;
    }

    .megamenu-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

    .search-form .btn-search {
        grid-column: span 1;
    }

    .listings-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 2rem 0;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .search-box {
        padding: 1rem;
    }

    .section-header h2 {
        font-size: 1.35rem;
    }
}
