/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #111827;
    background-color: #ffffff;
    display: flex; /* For sticky footer */
    flex-direction: column; /* For sticky footer */
    min-height: 100vh; /* For sticky footer */
}

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

/* Ensure main content takes available space for sticky footer */
main {
    flex-grow: 1;
}


/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background-color: #eab308;
    color: #713f12;
}

.btn-primary:hover {
    background-color: #ca8a04;
}

.btn-outline {
    background-color: transparent;
    color: #0ea5e9;
    border: 1px solid #bae6fd;
}

.btn-outline:hover {
    background-color: #f0f9ff;
}

.btn-ghost {
    background-color: transparent;
    color: #374151;
}

.btn-ghost:hover {
    background-color: #f3f4f6;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-full {
    width: 100%;
}

/* Header */
.header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #fef08a;
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between; /* This remains */
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none; /* Make logo clickable without underline */
    flex-shrink: 0; /* Prevent logo from shrinking */
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #facc15, #ca8a04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Styling for the new logo image */
.logo-image {
    height: 40px; /* You can adjust this value (e.g., 48px, 2.5rem) */
    width: auto;  /* This maintains the aspect ratio */
}

/* We use a separate class for the footer logo for independent styling */
.footer-logo-image {
    height: 50px; /* A little larger for the footer */
    width: auto;
    /* The original footer logo had text, so let's add some space below */
    margin-bottom: 1rem;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(234, 179, 8, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(234, 179, 8, 0.8);
    }
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.logo-text p {
    font-size: 0.75rem;
    color: #6b7280;
}

.nav {
    display: flex;
    justify-content: center; /* Center the nav items */
    align-items: center;
    gap: 1.5rem;
    flex-grow: 1; /* Allow nav to take up available space */
}

.nav a {
    color: #374151;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav a:hover {
    color: #ca8a04;
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0; /* Prevent buttons from shrinking */
    min-width: 220px; /* Give it a minimum width to prevent layout shifts */
    justify-content: flex-end; /* Align buttons to the right */
}

.mobile-menu-btn {
    display: none; /* Hidden by default, shown in media query */
    padding: 0.5rem; /* Add some padding for easier clicking */
}


@media (max-width: 768px) {
    .header-content {
        position: relative; /* For absolute positioning of nav */
    }
    .nav {
        position: absolute;
        top: 100%; /* Position below header */
        left: 0;
        right: 0;
        background-color: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        align-items: stretch; /* Stretch items */
        padding: 0; /* Remove padding, handled by links */
        border-top: 1px solid #fef08a;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        display: none; /* Initially hidden */
        z-index: 40; /* Below header but above content */
    }

    .nav.nav--open { /* Class to show menu */
        display: flex;
    }
    
    .nav a {
        padding: 1rem; /* Increase padding for touch targets */
        text-align: left; /* Align text to left */
        width: 100%;
        border-bottom: 1px solid #e5e7eb; /* Separator lines */
    }
    .nav a:last-child {
        border-bottom: none;
    }
    
    .auth-buttons .btn {
        padding: 0.4rem 0.6rem; /* Make buttons smaller on mobile */
        font-size: 0.75rem; /* Smaller font */
    }
    .auth-buttons .btn svg {
        display: none; /* Hide icons inside buttons on mobile to save space */
    }
    .mobile-menu-btn {
        display: flex;
    }
}

/* Hero Section */
.hero {
    position: relative;
    background: linear-gradient(135deg, #fefce8 0%, #ffffff 50%, #f0f9ff 100%);
    padding: 5rem 0;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    /* transform: translateZ(0); Ensure it's on its own layer for performance */
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: 5rem;
    left: 2.5rem;
    width: 18rem;
    height: 18rem;
    background-color: #facc15;
    border-radius: 50%;
    filter: blur(3rem);
}

.hero-bg::after {
    content: '';
    position: absolute;
    bottom: 5rem;
    right: 2.5rem;
    width: 24rem;
    height: 24rem;
    background-color: #38bdf8;
    border-radius: 50%;
    filter: blur(3rem);
}

.hero-content {
    text-align: center;
    max-width: 64rem;
    margin: 0 auto 4rem;
    position: relative;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.5rem;
    animation: fade-in 0.6s ease-out;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 4rem;
    }
}

.text-gradient {
    background: linear-gradient(to right, #eab308, #ca8a04);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #4b5563;
    margin-bottom: 2rem;
    animation: fade-in 0.6s ease-out 0.1s both;
}

@media (min-width: 768px) {
    .hero-subtitle {
        font-size: 1.5rem;
    }
}

.hero-description {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 3rem;
    animation: fade-in 0.6s ease-out 0.2s both;
}

.cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 4rem;
    animation: fade-in 0.6s ease-out 0.3s both;
}

@media (min-width: 640px) {
    .cta-buttons {
        flex-direction: row;
    }
}

.cta-buttons .btn {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-buttons .btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Feature Cards */
.feature-cards {
    display: grid;
    gap: 2rem;
    max-width: 80rem;
    margin: 0 auto 4rem;
    animation: fade-in 0.6s ease-out 0.4s both;
}

@media (min-width: 768px) {
    .feature-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid #fef08a;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.card-icon.solar {
    background-color: #fef9c3;
    color: #ca8a04;
}

.card-icon.sky {
    background-color: #e0f2fe;
    color: #0284c7;
}

.card-icon.green {
    background-color: #dcfce7;
    color: #16a34a;
}

.card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.card p {
    color: #4b5563;
    font-size: 0.875rem;
}

/* Stats */
.stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    animation: fade-in 0.6s ease-out 0.7s both;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-value.solar {
    color: #ca8a04;
}

.stat-value.sky {
    color: #0284c7;
}

.stat-value.green {
    color: #16a34a;
}

.stat-label {
    color: #4b5563;
    font-size: 0.875rem;
}

/* How It Works Section */
.how-it-works, .page-section { /* Added .page-section for generic content pages */
    padding: 5rem 0;
    background-color: #ffffff;
}
.page-section { /* Less padding for simpler content pages */
    padding: 3rem 0;
}


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

.section-header h2, .page-title { /* Added .page-title for generic content pages */
    font-size: 2.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}
.page-title {
    text-align: center;
    margin-bottom: 2rem;
}


.section-header p, .page-subtitle { /* Added .page-subtitle for generic content pages */
    font-size: 1.25rem;
    color: #4b5563;
    max-width: 48rem;
    margin: 0 auto;
}
.page-subtitle {
    text-align: center;
    margin-bottom: 3rem;
}


.steps {
    display: grid;
    gap: 2rem;
    max-width: 96rem;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .steps {
        grid-template-columns: repeat(4, 1fr);
    }
}

.step-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.step-number {
    position: absolute;
    top: -1rem;
    left: 1.5rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    background-color: #ffffff;
}

.step-number.solar {
    background-color: #fef9c3;
    color: #ca8a04;
    border-color: #fef08a;
}

.step-number.sky {
    background-color: #e0f2fe;
    color: #0284c7;
    border-color: #bae6fd;
}

.step-number.green {
    background-color: #dcfce7;
    color: #16a34a;
    border-color: #bbf7d0;
}

.step-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem auto 1rem;
}

.step-icon.solar {
    background-color: #fef9c3;
    color: #ca8a04;
}

.step-icon.sky {
    background-color: #e0f2fe;
    color: #0284c7;
}

.step-icon.green {
    background-color: #dcfce7;
    color: #16a34a;
}

.step-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.75rem;
}

.step-card p {
    color: #4b5563;
    font-size: 0.875rem;
    line-height: 1.5;
}

.legal-note {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 4rem;
    max-width: 64rem;
    margin-left: auto;
    margin-right: auto;
}

.legal-note h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 0.5rem;
}

.legal-note p {
    color: #1e40af;
    font-size: 0.875rem;
}

/* Ads Preview Section / Inzeraty Page */
.ads-preview, .inzeraty-page, .profil-page, .new-ad-page, .contact-page, .faq-page, .legal-page {
    padding: 5rem 0;
    background-color: #f9fafb;
}
.inzeraty-page, .profil-page, .new-ad-page, .contact-page, .faq-page, .legal-page {
    padding: 3rem 0; /* Less padding for full pages */
}


.ads-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: wrap; /* Allow tabs to wrap on small screens */
}

.tab-btn {
    background-color: #e5e7eb;
    color: #6b7280;
    border: none;
    padding: 0.75rem 1.5rem; /* Increased padding */
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.925rem; /* Slightly larger font */
    font-weight: 500;
    /* border-radius: 0.5rem 0.5rem 0 0; */ /* Removed for better wrapping */
    margin: 0.25rem; /* Spacing for wrapped tabs */
    border-radius: 0.375rem; /* Rounded corners for all tabs */
}

/* .tab-btn:first-child {
    border-radius: 0.5rem 0 0 0.5rem;
}

.tab-btn:last-child {
    border-radius: 0 0.5rem 0.5rem 0;
} */

.tab-btn.active {
    background-color: #eab308; /* Use primary color for active tab */
    color: #713f12;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ads-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .ads-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .ads-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.ad-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; /* For flex layout inside card */
    flex-direction: column; /* Stack content vertically */
}

.ad-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.ad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ad-type {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ad-type.solar {
    background-color: #fef9c3;
    color: #ca8a04;
}

.ad-type.sky {
    background-color: #e0f2fe;
    color: #0284c7;
}

.ad-location {
    color: #6b7280;
    font-size: 0.875rem;
}

.ad-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.75rem;
}
.ad-card h3 a { /* Make ad title a link */
    text-decoration: none;
    color: inherit;
}
.ad-card h3 a:hover {
    color: #ca8a04;
}


.ad-card p {
    color: #4b5563;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    flex-grow: 1; /* Make description take available space */
}

.ad-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #16a34a;
    margin-bottom: 1rem;
}

.ad-energy {
    color: #4b5563; /* A neutral, dark gray */
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem; /* Space between icon and text */
}

.ad-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; /* Push footer to bottom */
}

.ad-date {
    color: #6b7280;
    font-size: 0.75rem;
}

.ads-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Filters for Inzeraty page */
.filters {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.filters .form-group {
    margin-bottom: 0; /* Remove default margin for grid layout */
}
.filters .form-group label {
    font-size: 0.8rem; /* Smaller label */
}
.filters .form-group input,
.filters .form-group select {
    padding: 0.5rem; /* Smaller padding */
}

/* Detail Page specific styles */
.ad-detail-page {
    padding: 3rem 0;
    background-color: #f9fafb;
}
.ad-detail-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.ad-detail-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}
.ad-detail-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.ad-detail-meta {
    display: flex;
    gap: 1.5rem;
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.ad-detail-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.ad-detail-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: #16a34a;
    margin-bottom: 1.5rem;
}
.ad-detail-description h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}
.ad-detail-description p {
    line-height: 1.7;
    margin-bottom: 1rem;
}
.ad-detail-contact-btn {
    margin-top: 2rem;
}
.breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}
.breadcrumb a {
    color: #0ea5e9;
    text-decoration: none;
}
.breadcrumb a:hover {
    text-decoration: underline;
}
.breadcrumb span {
    color: #6b7280;
}


/* Profile Page */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 992px) {
    .profile-grid {
        grid-template-columns: 300px 1fr; /* Sidebar and main content */
    }
}
.profile-sidebar .card, .profile-main .card {
    text-align: left;
}
.profile-sidebar .card h3 {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}
.profile-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.profile-sidebar ul li a {
    display: block;
    padding: 0.75rem 0;
    color: #374151;
    text-decoration: none;
    border-radius: 0.25rem;
    transition: background-color 0.2s, color 0.2s;
}
.profile-sidebar ul li a:hover,
.profile-sidebar ul li a.active {
    background-color: #fef9c3;
    color: #ca8a04;
    padding-left: 0.5rem; /* Indent on hover/active */
}
.profile-main .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

/* Forms (New Ad, Contact) */
.form-container {
    max-width: 700px;
    margin: 0 auto;
    background-color: #fff;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.form-container .form-group textarea {
    min-height: 120px;
    resize: vertical;
}
.form-container .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: #fff; /* Ensure select background is white */
}


/* FAQ Page */
.faq-item {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}
.faq-question {
    padding: 1rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-question:hover {
    background-color: #f9fafb;
}
.faq-answer {
    padding: 1.5rem 1.5rem 1.5rem; /* Change first value from 0 to 1.5rem */
    border-top: 1px solid #e5e7eb;
    display: none; /* Hidden by default */
    color: #4b5563;
    line-height: 1.7; /* Add a bit more line spacing for readability */
}
.faq-answer p {
    margin-bottom: 0.5rem;
}
.faq-item.active .faq-answer {
    display: block;
}
.faq-item.active .faq-question svg {
    transform: rotate(180deg);
}
.faq-question svg {
    transition: transform 0.2s ease-in-out;
}


/* Footer */
.footer {
    background-color: #111827;
    color: #ffffff;
    padding: 4rem 0 2rem;
    margin-top: auto; /* For sticky footer */
}

.footer-content {
    display: grid;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.footer-logo .logo-icon {
    width: 2rem;
    height: 2rem;
    animation: none;
}

.footer-logo h3 {
    font-size: 1.125rem;
    font-weight: 700;
}

.footer-description {
    color: #9ca3af;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.footer-contact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
}

.footer-section ul {
    list-style: none;
}

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

.footer-section ul li a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-section ul li a:hover {
    color: #facc15;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

.footer-bottom p {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fade-in 0.3s ease-out;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 0.5rem;
    padding: 2rem;
    max-width: 28rem;
    width: 90%;
    max-height: 90vh; /* Use vh for max height */
    overflow-y: auto;
    animation: scale-in 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: #6b7280;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #111827;
}

.modal-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-tab {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500; /* Make tab text bolder */
}

.modal-tab.active {
    color: #eab308;
    border-bottom-color: #eab308;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-group input,
.form-group textarea, /* Added textarea */
.form-group select { /* Added select */
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease; /* Added box-shadow transition */
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #eab308;
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.1);
}
.field-error { /* For JS validation messages */
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Utility classes */
.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }


.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }


/* Responsive utilities */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .section-header h2, .page-title {
        font-size: 2rem;
    }
    
    .section-header p, .page-subtitle {
        font-size: 1rem;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    .filters {
        grid-template-columns: 1fr; /* Stack filters on small screens */
    }
    .ad-detail-header h1 {
        font-size: 1.75rem;
    }
    .ad-detail-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: #eab308;
    color: #713f12;
    border: none;
    font-size: 1.5rem; /* Increased font size for arrow */
    line-height: 1; /* Center arrow better */
    cursor: pointer;
    display: none; /* Initially hidden */
    z-index: 50;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.scroll-to-top:hover {
    background-color: #ca8a04;
    transform: translateY(-3px);
}

/* Add a class for ad items that should be hidden by JS filtering */
.ad-hidden {
    display: none !important;
}
/* Styling for the sorting <select> element */
.filters .form-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem; /* Make space for the arrow */
}