:root {
    /* RubRankings / Backpage Inspired Palette */
    --bg-body: #0a0a0a;
    /* Almost Black */
    --bg-header: #1a0520;
    /* Deep Purple Header */
    --bg-card: #181818;
    /* Card Background */
    --bg-card-hover: #222;

    --text-primary: #e0e0e0;
    --text-secondary: #aaaaaa;
    --text-muted: #666666;

    --accent-purple: #9c27b0;
    /* Bright Purple */
    --accent-gold: #ffd700;
    /* Gold for Premium */
    --accent-blue: #448aff;
    /* Links/Buttons */
    --accent-red: #d32f2f;
    /* Warnings/Errors */

    --border-dark: #333333;
    --border-highlight: #4a148c;
    /* Purple Border */

    --font-main: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* Reset & Base */
* {
    box-sizing: border-box;
    outline: none;
}

/* SPONSOR BADGE - Gold Star Label */
.ad-sponsor-badge {
    position: absolute;
    top: 32px;
    left: 8px;
    background: linear-gradient(135deg, #ffd700, #ffa500);
    color: #000;
    font-size: 10px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 3px;
    z-index: 10;
    text-transform: uppercase;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 14px;
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Layout Utilities */
.container {
    max-width: 1400px;
    /* Wide layout like listing sites */
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Premium Header --- */
.main-header {
    background: linear-gradient(to bottom, #2d0b33, #1a0520);
    /* Gradient Purple */
    border-bottom: 3px solid var(--accent-purple);
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-text {
    font-size: 28px;
    font-weight: 900;
    color: white;
    text-shadow: 0 0 5px var(--accent-purple), 0 0 10px var(--accent-purple);
    letter-spacing: -1px;
    text-decoration: none !important;
}

.brand-text span {
    color: var(--accent-purple);
}

/* Header Actions */
.user-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid var(--border-highlight);
}

.login-link {
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
}

.post-ad-btn {
    background: var(--accent-gold);
    color: #000;
    font-weight: 900;
    padding: 6px 15px;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 12px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    border: none;
    cursor: pointer;
}

.post-ad-btn:hover {
    background: #fff;
    text-decoration: none;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
}

/* --- Category Navigation (Top Bar) --- */
.category-nav {
    background: #111;
    border-bottom: 1px solid var(--border-dark);
    padding: 8px 0;
    margin-bottom: 20px;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
}

.nav-links a {
    color: var(--text-secondary);
}

.nav-links a:hover {
    color: var(--accent-purple);
    text-decoration: none;
}

.nav-links a.active {
    color: var(--accent-purple);
    border-bottom: 2px solid var(--accent-purple);
}


/* --- Listings Grid (RubRankings Style) --- */
.section-title {
    font-size: 20px;
    color: var(--accent-gold);
    border-bottom: 1px solid var(--border-dark);
    padding-bottom: 10px;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-weight: 700;
}

/* The Grid */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    /* Responsive Grid */
    gap: 15px;
    margin-bottom: 40px;
}

/* Ad Card */
.ad-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
}

.ad-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border-color: var(--accent-purple);
    z-index: 10;
}

/* Image */
.ad-image-container {
    width: 100%;
    height: 250px;
    /* Tall portrait style */
    position: relative;
    background: #000;
}

.ad-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.ad-card:hover .ad-image {
    opacity: 1;
}

/* Overlays (Age, Verified) */
.ad-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 40px 10px 10px 10px;
    pointer-events: none;
}

.ad-age-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    font-size: 11px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: bold;
}

.ad-verified-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent-blue);
    color: white;
    padding: 2px 5px;
    font-size: 10px;
    border-radius: 2px;
    font-weight: bold;
    text-transform: uppercase;
    display: none;
    /* Only for verified */
}

/* Card Content */
.ad-info {
    padding: 10px;
}

.ad-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}

.ad-location {
    color: var(--accent-purple);
    font-weight: bold;
}

/* --- Special Ad Types --- */
.ad-card.premium {
    border: 1px solid var(--accent-gold);
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.2);
}

.ad-card.premium .ad-title {
    color: var(--accent-gold);
}

.ad-card.sponsor {
    border: 1px solid var(--accent-blue);
}

.ad-card.sponsor .ad-title {
    color: var(--accent-blue);
}

/* --- Location Grid (Homepage) --- */
.states-wrapper {
    background: #121212;
    padding: 20px;
    border: 1px solid var(--border-dark);
}

.states-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.state-group h3 {
    color: var(--accent-gold);
    font-size: 14px;
    border-bottom: 1px solid #333;
    padding-bottom: 3px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.city-link {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 2px 0;
}

.city-link:hover {
    color: #fff;
    padding-left: 3px;
}

/* --- Footer --- */
.main-footer {
    background: #000;
    border-top: 2px solid var(--accent-purple);
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
    color: #555;
    font-size: 12px;
}

/* Login/Form Overrides for Dark Mode */
.login-card-container {
    background-color: rgba(0, 0, 0, 0.8) !important;
}

.login-card {
    background: #1a1a1a !important;
    border: 1px solid var(--accent-purple) !important;
    color: #fff;
}

.login-title {
    color: #fff !important;
}

.auth-brand-text {
    color: var(--accent-purple) !important;
}

/* --- Mobile --- */
@media (max-width: 600px) {
    .container {
        padding: 0 10px;
        /* More space for content */
    }

    .ads-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        /* Tighter gap */
    }

    .ad-image-container {
        height: 160px;
        /* Slightly shorter to see more rows */
    }

    .brand-text {
        font-size: 20px;
        /* Prevent wrapping */
    }

    .nav-links {
        gap: 15px;
        white-space: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        /* Smooth scroll iOS */
    }

    /* Better State/City Grid for Mobile */
    .states-wrapper {
        padding: 10px;
    }

    .states-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Force 2 columns */
        gap: 10px;
    }

    .state-block {
        padding: 10px;
    }

    .state-title {
        font-size: 14px;
    }

    .city-list a {
        padding: 8px 0;
        /* Larger touch target */
        display: block;
        border-bottom: 1px solid #222;
        /* Separator lines */
    }
}

/* --- States & Cities Grid --- */
.states-wrapper {
    margin-top: 20px;
}

.states-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
}

.state-block {
    background: #111;
    border: 1px solid #333;
    border-radius: 5px;
    padding: 15px;
}

.state-title {
    display: block;
    color: var(--accent-gold);
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    text-transform: uppercase;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

.state-title:hover {
    color: #fff;
    text-decoration: none;
}

.city-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.city-list li {
    margin: 5px 0;
}

.city-list a {
    color: var(--accent-blue);
    font-size: 13px;
}

.city-list a:hover {
    color: #fff;
}

/* --- Google Sign-In Button (RED) --- */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #db4437, #c1351d);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(219, 68, 55, 0.4);
}

.btn-google:hover {
    background: linear-gradient(135deg, #e74c3c, #db4437);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(219, 68, 55, 0.6);
}

.btn-google:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(219, 68, 55, 0.3);
}