/* styles.css - Modern, Premium styling for FREEADS.by */

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

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #0f172a;
    --text-main: #334155;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --accent: #f59e0b;
    --accent-light: #fef3c7;
    --success: #10b981;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -4px rgba(0,0,0,0.05);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    font-weight: 600;
}

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

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

/* Header & Navigation */
header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary);
    font-family: 'Outfit', sans-serif;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 8px;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-dark);
}

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

/* Hero Section */
.hero {
    background: radial-gradient(circle at 10% 20%, rgba(239, 246, 255, 0.6) 0%, rgba(255, 255, 255, 0.1) 90%);
    padding: 80px 0 60px;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.hero-inner-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    align-items: center;
}

.hero-text-content {
    text-align: left;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 16px;
    line-height: 1.2;
    font-weight: 700;
}

.hero p {
    font-size: 17px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.hero-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
}

.browser-mockup {
    width: 100%;
    max-width: 480px;
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: var(--transition);
}

.browser-mockup:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg) scale(1.02);
}

.browser-header {
    height: 36px;
    background-color: #f1f5f9;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 6px;
}

.browser-header .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.browser-header .dot:nth-child(1) { background-color: #ef4444; }
.browser-header .dot:nth-child(2) { background-color: #eab308; }
.browser-header .dot:nth-child(3) { background-color: #22c55e; }

.browser-address {
    margin-left: 20px;
    background-color: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 11px;
    padding: 2px 24px;
    color: var(--text-muted);
    flex-grow: 0.5;
    text-align: center;
    font-family: monospace;
}

.browser-content-img {
    width: 100%;
    height: 270px;
    object-fit: cover;
    display: block;
}

/* Domain Notice Banner */
.domain-notice {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--accent-light);
    color: #92400e;
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid #fde68a;
    animation: fadeIn 0.5s ease;
}

.domain-notice svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Search Bar */
.search-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 8px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    gap: 8px;
    border: 1px solid var(--border);
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper svg {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    width: 20px;
    height: 20px;
}

.search-input {
    width: 100%;
    border: none;
    padding: 12px 12px 12px 48px;
    font-size: 15px;
    color: var(--text-dark);
    background: transparent;
    outline: none;
}

.search-select {
    padding: 12px 24px 12px 12px;
    border: none;
    border-left: 1px solid var(--border);
    outline: none;
    background: transparent;
    color: var(--text-dark);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    width: 160px;
}

/* Layout Sections */
.section {
    padding: 48px 0;
}

.section-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 28px;
}

.section-title {
    font-size: 26px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
}

.category-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    color: var(--primary);
}

.cat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.category-card:hover .cat-icon-wrapper {
    background-color: var(--primary);
    color: white;
}

.cat-icon {
    width: 24px;
    height: 24px;
}

.category-name {
    font-size: 13px;
    font-weight: 600;
}

.category-count {
    font-size: 11px;
    color: var(--text-muted);
}

/* Ads Grid */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 24px;
}

.ad-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.ad-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

.ad-image-placeholder {
    height: 180px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 20px;
    font-family: 'Outfit', sans-serif;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ad-image-svg-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.ad-image-text {
    z-index: 2;
    padding: 16px;
    text-align: center;
}

.ad-price-tag {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background-color: var(--secondary);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    z-index: 3;
}

.ad-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ad-category {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.ad-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 44px;
}

.ad-title:hover {
    color: var(--primary);
}

.ad-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}

.ad-city {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    color: var(--text-dark);
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    padding: 20px 0;
}

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

.breadcrumbs-separator {
    color: var(--border);
}

/* Layout Wrapper for Categories & Main content on Subpages */
.subpage-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
    margin-top: 24px;
}

.sidebar-widget {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-size: 18px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.sidebar-list {
    list-style: none;
}

.sidebar-list-item {
    margin-bottom: 10px;
}

.sidebar-list-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-main);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
}

.sidebar-list-item a:hover,
.sidebar-list-item.active a {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

/* Details Page */
.details-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: grid;
    grid-template-columns: 1fr 380px;
}

.details-main {
    padding: 32px;
    border-right: 1px solid var(--border);
}

.details-gallery {
    height: 400px;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.details-title {
    font-size: 28px;
    line-height: 1.3;
    margin-bottom: 16px;
}

.details-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.details-desc-title {
    font-size: 20px;
    margin-bottom: 12px;
}

.details-desc {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-main);
    white-space: pre-line;
}

.details-sidebar {
    padding: 32px;
    background-color: #fafbfd;
}

.price-box {
    margin-bottom: 28px;
}

.price-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.price-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-top: 4px;
    font-family: 'Outfit', sans-serif;
}

.seller-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 12px;
}

.seller-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-dark);
    font-size: 18px;
}

.seller-name {
    font-weight: 600;
    font-size: 15px;
}

.seller-role {
    font-size: 12px;
    color: var(--text-muted);
}

.phone-btn-container {
    margin-bottom: 24px;
}

.phone-btn {
    width: 100%;
    background-color: var(--success);
    color: white;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
    transition: var(--transition);
}

.phone-btn:hover {
    background-color: #059669;
    transform: translateY(-1px);
}

.phone-revealed {
    display: none;
    width: 100%;
    background-color: var(--primary-light);
    color: var(--primary);
    border: 2px dashed var(--primary);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 18px;
    text-align: center;
    animation: slideDown 0.3s ease;
}

/* Footer */
footer {
    background-color: var(--secondary);
    color: #94a3b8;
    padding: 60px 0 30px;
    margin-top: 80px;
    border-top: 1px solid #1e293b;
    font-size: 14px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-title {
    color: white;
    font-size: 16px;
    margin-bottom: 16px;
}

.footer-desc {
    line-height: 1.7;
    margin-top: 16px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid #1e293b;
    font-size: 12px;
}

/* Cities List Box */
.cities-list-box {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.city-pill {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
}

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

/* Modal Stub styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    padding: 32px;
    position: relative;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    animation: modalOpen 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.modal-icon svg {
    width: 32px;
    height: 32px;
}

.modal-title {
    font-size: 22px;
    margin-bottom: 12px;
}

.modal-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

/* Keyframe Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modalOpen {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .hero-inner-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }
    
    .hero-text-content {
        text-align: center;
    }
    
    .hero p {
        margin: 0 auto 32px;
        max-width: 600px;
    }
    
    .subpage-layout {
        grid-template-columns: 1fr;
    }
    
    .details-container {
        grid-template-columns: 1fr;
    }
    
    .details-main {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 32px;
    }
    .browser-content-img {
        height: 200px;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .header-actions .btn-outline {
        display: none;
    }
    .search-container {
        flex-direction: column;
        gap: 4px;
        padding: 4px;
    }
    .search-select {
        border-left: none;
        border-top: 1px solid var(--border);
        width: 100%;
        background-position: right 16px center;
    }
}

/* Cookie Banner styling */
.cookie-banner {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 420px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    flex-direction: column;
    gap: 12px;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.cookie-banner-content p {
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.5;
}

.cookie-banner-actions {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 576px) {
    .cookie-banner {
        bottom: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        border-bottom: none;
        border-left: none;
        border-right: none;
    }
}
