@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap');

:root {
    --sahibinden-blue: #003366;
    --sahibinden-light-blue: #486078;
    --sahibinden-yellow: #f2c200;
    --sahibinden-yellow-hover: #e0b300;
    --sahibinden-bg: #f1f3f7;
    --border-color: #e3e3e3;
    --text-color: #333333;
    --link-color: #125488;
    --white: #ffffff;
}

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

body {
    background-color: var(--sahibinden-bg);
    color: var(--text-color);
    font-size: 13px;
    line-height: 1.5;
}

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

a:hover {
    text-decoration: underline;
}

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

/* Header */
header {
    background-color: var(--sahibinden-blue);
    border-bottom: 3px solid var(--sahibinden-yellow);
    padding: 12px 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -1px;
}

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

.header-nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-login {
    color: var(--white) !important;
    font-weight: 600;
    font-size: 12px;
}

.btn-post-ad {
    background-color: var(--sahibinden-yellow);
    color: #000 !important;
    padding: 8px 16px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 12px;
    text-decoration: none !important;
}

.btn-post-ad:hover {
    background-color: var(--sahibinden-yellow-hover);
    text-decoration: none !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--sahibinden-blue) 0%, var(--sahibinden-light-blue) 100%);
    padding: 40px 0;
    color: var(--white);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-section h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.hero-section p {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 20px;
}

.search-bar-wrap {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-bar-wrap input {
    width: 100%;
    padding: 12px 20px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    outline: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.search-bar-wrap button {
    position: absolute;
    right: 5px;
    top: 5px;
    background-color: var(--sahibinden-yellow);
    border: none;
    padding: 7px 15px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
}

.search-bar-wrap button:hover {
    background-color: var(--sahibinden-yellow-hover);
}

/* Main Layout */
.main-layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 40px;
}

/* Left Sidebar (Filters & Categories) */
.sidebar {
    width: 250px;
    flex-shrink: 0;
}

.filter-box {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 15px;
    padding: 15px;
}

.filter-box h3 {
    font-size: 13px;
    font-weight: 700;
    color: #000;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.category-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

.category-list::-webkit-scrollbar {
    width: 5px;
}

.category-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.category-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.category-list::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.category-list li {
    padding: 6px 0;
    border-bottom: 1px dashed #f0f0f0;
}

.category-list li a {
    color: #444;
    display: flex;
    justify-content: space-between;
}

.category-list li a:hover {
    color: var(--link-color);
}

.category-list li.active a {
    font-weight: 700;
    color: var(--sahibinden-blue);
}

.filter-form .form-group {
    margin-bottom: 12px;
}

.filter-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
}

.range-inputs {
    display: flex;
    gap: 5px;
    align-items: center;
}

.range-inputs input {
    width: 100%;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 12px;
    outline: none;
}

.btn-filter-submit {
    background-color: var(--sahibinden-yellow);
    color: #000;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 3px;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-filter-submit:hover {
    background-color: var(--sahibinden-yellow-hover);
}

.btn-filter-reset {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 11px;
    color: #888;
}

/* Right Content Area (Listings) */
.listings-content {
    flex-grow: 1;
}

.listings-header {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.listings-header h2 {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

/* Sahibinden Table Style */
.listings-table-wrapper {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.listings-table {
    width: 100%;
    border-collapse: collapse;
}

.listings-table th {
    background-color: #fafafa;
    color: #666;
    font-weight: 600;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    font-size: 12px;
}

.listings-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.listings-table tr:hover td {
    background-color: #f7f9fc;
}

.listings-table .col-thumb {
    width: 90px;
}

.listings-table .thumb-img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.listings-table .col-title a {
    color: var(--link-color);
    font-weight: 600;
    font-size: 13px;
}

.listings-table .col-price {
    font-weight: 700;
    color: #111;
    white-space: nowrap;
}

.listings-table .col-spec {
    color: #555;
}

.listings-table .col-date {
    color: #666;
    font-size: 11px;
}

/* Detail Page Layout (Sahibinden Style) */
.detail-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 40px;
}

.detail-main {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
}

.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-header {
    margin-bottom: 20px;
}

.detail-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.detail-gallery {
    margin-bottom: 20px;
}

.main-image-wrap {
    width: 100%;
    height: 400px;
    background-color: #f6f6f6;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.main-image-wrap img, .main-image-wrap video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.thumbs-list {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.thumb-item {
    width: 70px;
    height: 50px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    opacity: 0.7;
}

.thumb-item:hover, .thumb-item.active {
    opacity: 1;
    border: 2px solid var(--sahibinden-blue);
}

.video-thumb-placeholder {
    width: 70px;
    height: 50px;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.specs-table tr:last-child {
    border-bottom: none;
}

.specs-table td {
    padding: 10px 15px;
}

.specs-table td:first-child {
    color: #666;
    font-weight: 600;
    width: 120px;
}

.specs-table td:last-child {
    color: #000;
    font-weight: 700;
}

.price-box {
    background-color: #f7f9fc;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px 20px;
    text-align: center;
    margin-bottom: 15px;
}

.price-box .price-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.price-box .price-value {
    font-size: 24px;
    font-weight: 700;
    color: #d91c1c;
}

.contact-box {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
}

.contact-box h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.whatsapp-button {
    background-color: #25d366;
    color: var(--white) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
    width: 100%;
    margin-bottom: 10px;
}

.whatsapp-button:hover {
    background-color: #20ba5a;
    text-decoration: none;
}

.call-button {
    background-color: var(--sahibinden-blue);
    color: var(--white) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
    width: 100%;
    margin-top: 10px;
    text-decoration: none !important;
    transition: background-color 0.2s;
}

.call-button:hover {
    background-color: #0c233c;
    text-decoration: none !important;
}

.desc-box {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
    margin-top: 20px;
}

.desc-box h2 {
    font-size: 15px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.desc-text {
    font-size: 13px;
    line-height: 1.6;
    color: #444;
    white-space: pre-line;
}

/* Footer */
footer {
    background-color: #2a3f54;
    color: #ccc;
    padding: 30px 0;
    margin-top: 50px;
    border-top: 1px solid var(--border-color);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    /* Header Mobile Adjustments */
    header {
        padding: 10px 0;
    }
    .header-inner {
        flex-direction: row;
        justify-content: space-between;
    }
    .logo {
        font-size: 18px;
    }
    .header-nav {
        gap: 8px;
    }
    .btn-login {
        font-size: 11px;
        margin-right: 5px !important;
    }
    .btn-post-ad {
        padding: 6px 12px;
        font-size: 11px;
    }

    /* Hero Section Mobile Adjustments */
    .hero-section {
        padding: 25px 0;
    }
    .hero-section h1 {
        font-size: 18px;
    }
    .hero-section p {
        font-size: 11px;
        margin-bottom: 15px;
    }
    .search-bar-wrap input {
        padding: 10px 15px;
        font-size: 12px;
    }
    .search-bar-wrap button {
        padding: 5px 12px;
        font-size: 12px;
    }

    /* Main Layout stacking */
    .main-layout {
        flex-direction: column;
        gap: 15px;
        margin-top: 15px;
    }
    .sidebar {
        width: 100%;
    }

    /* Modern horizontal sliding Capsule Menu for Brands */
    .category-list {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 8px;
        max-height: none;
        scrollbar-width: none; /* Hide scrollbar for Firefox */
    }
    .category-list::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Chrome/Safari */
    }
    .category-list li {
        border-bottom: none;
        background: #eef2f6;
        padding: 6px 14px;
        border-radius: 20px;
        display: inline-block;
    }
    .category-list li a {
        display: inline;
        color: #444;
        font-size: 12px;
    }
    .category-list li a span {
        margin-left: 2px;
        font-size: 10px;
        opacity: 0.7;
    }
    .category-list li.active {
        background: var(--sahibinden-blue);
    }
    .category-list li.active a {
        color: #fff !important;
        font-weight: 600;
    }

    /* Compact forms on mobile */
    .filter-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .filter-form .form-group {
        margin-bottom: 5px;
    }
    .filter-form .form-group:nth-child(1) {
        grid-column: span 2;
    }
    .btn-filter-submit {
        grid-column: span 2;
        padding: 8px;
    }
    .btn-filter-reset {
        grid-column: span 2;
        margin-top: 2px;
    }

    /* Responsive Grid Feed instead of cramped table */
    .listings-table-wrapper {
        border: none;
        background: transparent;
    }
    .listings-table, 
    .listings-table thead, 
    .listings-table tbody, 
    .listings-table tr, 
    .listings-table td {
        display: block;
    }
    .listings-table thead {
        display: none;
    }
    .listings-table tr {
        background-color: var(--white);
        border: 1px solid var(--border-color);
        border-radius: 6px;
        padding: 10px;
        margin-bottom: 10px;
        position: relative;
        min-height: 95px;
    }
    .listings-table td {
        padding: 0 !important;
        border: none !important;
    }
    .listings-table tr:hover td {
        background-color: transparent;
    }
    
    /* Left column - floated thumbnail */
    .listings-table .col-thumb {
        float: left;
        width: 100px;
        margin-right: 12px;
    }
    .listings-table .thumb-img {
        width: 100px;
        height: 75px;
        border-radius: 4px;
        border: 1px solid #eee;
    }
    
    /* Right column text styling using left margin alignment */
    .listings-table td.col-title {
        display: block !important;
        margin-left: 112px !important;
        padding-right: 95px !important; /* Prevents title text from overlapping price tag */
        margin-bottom: 4px !important;
    }
    .listings-table td.col-title a {
        font-size: 12px;
        font-weight: 600;
        color: #333;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.4;
    }
    
    /* Brand / Model line */
    .listings-table td.col-spec:nth-of-type(3) {
        display: block !important;
        margin-left: 112px !important;
        font-size: 11px;
        font-weight: 600;
        color: #555;
        margin-bottom: 6px !important;
    }
    
    /* Year Badge */
    .listings-table td.col-spec:nth-of-type(4) {
        display: inline-block !important;
        margin-left: 112px !important;
        background: #f1f3f7;
        padding: 2px 6px;
        border-radius: 3px;
        font-size: 10px;
        color: #666;
    }
    
    /* KM Badge */
    .listings-table td.col-spec:nth-of-type(5) {
        display: inline-block !important;
        margin-left: 5px !important;
        background: #f1f3f7;
        padding: 2px 6px;
        border-radius: 3px;
        font-size: 10px;
        color: #666;
    }
    
    /* Absolute tags for Price and Date */
    .listings-table td.col-price {
        position: absolute;
        right: 10px;
        top: 10px;
        font-size: 13px;
        font-weight: 700;
        color: #d91c1c;
        text-align: right;
        margin-left: 0 !important;
        display: block !important;
    }
    .listings-table td.col-date {
        position: absolute;
        right: 10px;
        bottom: 10px;
        font-size: 10px;
        color: #999;
        margin-left: 0 !important;
        display: block !important;
    }

    /* Detail Page Mobile Layout */
    .detail-layout {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 15px;
    }
    .main-image-wrap {
        height: 250px;
    }
    .thumb-item, .video-thumb-placeholder {
        width: 60px;
        height: 42px;
    }
    .price-box {
        margin-bottom: 0;
    }
    
    /* Hakkimizda & Iletisim Box Stacking */
    #hakkimizda > div {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 15px !important;
    }
    
    /* Footer stacking */
    .footer-inner {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}
