/* css/front_style.css */

/* --- Variables --- */
:root {
    --primary-color: #ffffff;
    --header-bg: #333742;
    --hover-color: #FFD700;
    --accent-color: #FF6B6B;
    --body-bg: #ecf0f1;
    --text-color: #2c3e50;
    --subtle-gray: #555964;
    --font-family: 'Arial', sans-serif;
}

/* --- Global Resets --- */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: var(--font-family);
    background-color: var(--body-bg);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    box-sizing: border-box;
}

*, *:before, *:after { box-sizing: inherit; }

/* --- Utilities --- */
@media (min-width: 901px) {
    .d-md-none { display: none !important; }
}

/* --- Header Styling --- */
header {
    background-color: var(--header-bg);
    padding: 15px 30px;
    border-bottom: 2px solid var(--subtle-gray);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); 
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-logo { height: 40px; width: auto; display: block; }

.nav-container { display: flex; align-items: center; gap: 30px; }
.main-nav ul { list-style: none; padding: 0; margin: 0; display: flex; align-items: center; gap: 25px; }
.main-nav li a { text-decoration: none; color: var(--primary-color); font-size: 16px; font-weight: 600; transition: color 0.3s ease; display: flex; align-items: center; }
.main-nav li a:hover { color: var(--hover-color); }
.icon-spacing { margin-right: 8px; font-size: 18px; }

.main-nav .post-ad-btn {
    background-color: var(--hover-color);
    color: var(--text-color) !important;
    padding: 10px 18px;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(255, 215, 0, 0.4);
}
.main-nav .post-ad-btn:hover {
    background-color: var(--accent-color);
    color: var(--primary-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 107, 107, 0.6);
}

.user-links { display: flex; align-items: center; gap: 15px; }
.user-links a { text-decoration: none; color: var(--primary-color); transition: color 0.3s ease; }
.user-links a:hover { color: var(--hover-color); }
.user-links .auth-separator { color: var(--subtle-gray); font-size: 18px; }

.menu-toggle { display: none; background: none; border: none; font-size: 28px; cursor: pointer; color: var(--primary-color); }
.filter-toggle-button { display: none; width: 100%; padding: 12px; background-color: #fff; color: #333; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; font-weight: bold; cursor: pointer; margin: 10px 0; text-align: left; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.filter-toggle-button i { margin-right: 8px; color: var(--accent-color); }

/* --- Full Page Layout --- */
.full-page-layout { display: flex; width: 100%; min-height: 80vh; padding: 0; gap: 0; }
.layout-sidebar { width: 300px; flex-shrink: 0; background: #fff; border-right: 1px solid #e0e0e0; padding: 20px; z-index: 10; }
.layout-content { flex-grow: 1; padding: 20px; background-color: var(--body-bg); }
footer { width: 100%; box-sizing: border-box; background: var(--header-bg); color: var(--primary-color); padding: 40px 0; text-align: center; overflow: hidden; }

/* --- Masonry Grid (Index) --- */
.masonry-grid { column-count: 5; column-gap: 15px; width: 100%; }
.ad-card-masonry { break-inside: avoid; background: #fff; border: 1px solid #ddd; border-radius: 4px; margin-bottom: 15px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); transition: transform 0.2s ease; overflow: hidden; display: inline-block; width: 100%; }
.ad-card-masonry:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.15); }
.ad-link-wrapper { text-decoration: none; color: inherit; display: block; }
.ad-image-wrapper { position: relative; width: 100%; line-height: 0; }
.ad-image-wrapper img { width: 100%; height: auto; display: block; border-bottom: 1px solid #eee; }
.ad-badge-new { position: absolute; top: 5px; right: 5px; background: var(--accent-color); color: #fff; font-size: 10px; padding: 2px 5px; border-radius: 3px; font-weight: bold; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.ad-content-masonry { padding: 10px 10px 5px 10px; }
.ad-title { font-size: 1rem; font-weight: bold; margin: 0; line-height: 1.3; color: #333; }
.ad-footer-masonry { padding: 0 10px 15px 10px; }
.ad-category-link { margin-top: 5px; font-size: 0.8rem; color: #666; }
.ad-category-link a { color: var(--accent-color); text-decoration: none; font-weight: 600; }
.ad-category-link a:hover { text-decoration: underline; }
.ad-desc-snippet { margin-top: 6px; font-size: 0.85rem; color: #555; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* --- AD DETAILS PAGE STYLES (NEW) --- */
.ad-page-container { background: #fff; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); overflow: hidden; margin-top: 20px; }
.ad-breadcrumbs { padding: 15px 30px; background: #f8f9fa; border-bottom: 1px solid #eee; font-size: 0.9rem; color: #666; }
.ad-breadcrumbs a { color: #333; text-decoration: none; font-weight: 500; }
.ad-breadcrumbs a:hover { color: var(--accent-color); text-decoration: underline; }
.ad-breadcrumbs .separator { margin: 0 8px; color: #ccc; }

.ad-content-wrapper { display: flex; flex-wrap: wrap; }

/* Left Gallery */
.ad-gallery-section { flex: 1 1 500px; padding: 30px; border-right: 1px solid #f0f0f0; }
.main-photo-frame { width: 100%; height: 500px; background: #000; display: flex; align-items: center; justify-content: center; border-radius: 8px; overflow: hidden; margin-bottom: 15px; position: relative; }
.main-photo-frame img { max-width: 100%; max-height: 100%; display: block; object-fit: contain; }

/* Gallery Arrows */
.gallery-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); color: #fff; border: none; font-size: 24px; padding: 10px 15px; cursor: pointer; transition: 0.3s; z-index: 5; border-radius: 4px; }
.gallery-arrow:hover { background: rgba(0,0,0,0.8); }
.gallery-arrow.prev { left: 10px; }
.gallery-arrow.next { right: 10px; }

.thumbnail-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.thumbnail-strip img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; cursor: pointer; opacity: 0.6; transition: 0.2s; border: 2px solid transparent; }
.thumbnail-strip img:hover, .thumbnail-strip img.active { opacity: 1; border-color: var(--accent-color); }

/* Right Info */
.ad-info-section { flex: 1 1 350px; padding: 30px; background: #fff; }
.ad-header-title { margin-top: 0; font-size: 1.8rem; line-height: 1.2; color: var(--header-bg); margin-bottom: 10px; }
.ad-meta-data { display: flex; gap: 20px; color: #777; font-size: 0.9rem; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid #eee; }
.ad-meta-data span { display: flex; align-items: center; gap: 6px; }

/* Contact */
.contact-actions { background: #f9f9f9; padding: 25px; border-radius: 12px; margin-bottom: 30px; }
.phone-label { font-size: 0.85rem; color: #666; margin-bottom: 5px; text-transform: uppercase; font-weight: bold; }
.primary-phone { font-size: 1.8rem; font-weight: 800; color: #333; display: flex; align-items: center; gap: 10px; margin-bottom: 15px; text-decoration: none; }
.action-buttons-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.contact-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 6px; color: #fff; text-decoration: none; font-weight: bold; transition: transform 0.2s; }
.contact-btn:hover { transform: translateY(-2px); }
.btn-whatsapp { background-color: #25D366; }
.btn-viber { background-color: #7360f2; }
.btn-website { background-color: #333; grid-column: span 2; }

/* Features */
.features-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.features-table tr { border-bottom: 1px solid #f5f5f5; }
.features-table td { padding: 8px 0; font-size: 0.95rem; }
.feature-label { color: #777; width: 45%; }
.feature-value { color: #333; font-weight: 600; }

/* Bottom Section */
.ad-bottom-section { padding: 30px; border-top: 1px solid #f0f0f0; }
.ad-description-text { font-size: 1.05rem; line-height: 1.7; color: #444; white-space: pre-wrap; margin-bottom: 30px; }
.attrs-group h3 { font-size: 1.1rem; border-bottom: 2px solid #eee; padding-bottom: 8px; margin-bottom: 15px; color: #333; text-transform: uppercase; }
.services-list { display: flex; flex-wrap: wrap; gap: 10px; }
.service-tag { background: #eef2f5; color: #555; padding: 6px 12px; border-radius: 20px; font-size: 0.9rem; display: flex; align-items: center; gap: 6px; }
.service-tag i { color: var(--accent-color); }

/* --- Forms --- */
.registration-form, .login-form, .ad-form { background-color: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); max-width: 500px; margin: 50px auto; }
.registration-form h2, .login-form h2 { text-align: center; margin-bottom: 20px; }
.registration-form input, .login-form input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; margin-bottom: 15px; }
.registration-form input[type="submit"], .login-form input[type="submit"] { background-color: var(--header-bg); color: white; cursor: pointer; font-weight: bold; }

/* --- Breakpoints --- */
@media (max-width: 1600px) { .masonry-grid { column-count: 4; } }
@media (max-width: 1200px) { .masonry-grid { column-count: 3; } }

@media (max-width: 900px) {
    header { padding: 10px 20px; }
    .menu-toggle { display: block; }
    .nav-container { display: none; flex-direction: column; align-items: flex-start; position: absolute; top: 65px; left: 0; width: 100%; background-color: var(--header-bg); border-top: 1px solid var(--subtle-gray); padding: 10px 0; z-index: 999; }
    .nav-container.active { display: flex; }
    .main-nav ul { flex-direction: column; width: 100%; }
    .main-nav li a { padding: 10px 20px; width: 100%; border-bottom: 1px solid var(--subtle-gray); }
    .full-page-layout { flex-direction: column; }
    .layout-sidebar { width: 100%; display: none; border-right: none; border-bottom: 1px solid #ddd; }
    .filter-toggle-button { display: block; }
    .masonry-grid { column-count: 2; column-gap: 10px; }
    
    /* Ad Page Mobile */
    .ad-content-wrapper { flex-direction: column; }
    .ad-gallery-section { border-right: none; border-bottom: 1px solid #eee; padding: 15px; }
    .main-photo-frame { height: 300px; }
    .ad-info-section { padding: 20px; }
    .ad-header-title { font-size: 1.5rem; }
    .primary-phone { font-size: 1.5rem; }
}
@media (max-width: 500px) { .masonry-grid { column-count: 1; } }
@media (min-width: 901px) { .d-md-none { display: none !important; } }