/*
 * board-ads/css/main.css
 * Базовые стили доски объявлений.
 */

:root {
    --bo-primary: #007bff;
    --bo-primary-hover: #0056b3;
    --bo-bg: #f8f9fa;
    --bo-card-bg: #ffffff;
    --bo-text: #212529;
    --bo-muted: #6c757d;
    --bo-border: #dee2e6;
    --bo-radius: 8px;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bo-bg);
    color: var(--bo-text);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

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

/* --- Header --- */
.bo-header {
    background: var(--bo-card-bg);
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.bo-header .bo-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.bo-logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--bo-primary);
    text-decoration: none;
}

.bo-nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

.bo-nav a {
    color: var(--bo-text);
    text-decoration: none;
    font-size: 0.95rem;
}

.bo-user {
    color: var(--bo-muted);
    font-size: 0.9rem;
}

.bo-btn-add {
    background-color: var(--bo-primary);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--bo-radius);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
}

.bo-btn-add:hover {
    background-color: var(--bo-primary-hover);
}

/* --- Categories Grid --- */
.bo-categories {
    padding: 32px 0;
}

.bo-categories h2 {
    margin-bottom: 24px;
    font-size: 1.5rem;
}

.bo-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.bo-cat-card {
    background: var(--bo-card-bg);
    border: 1px solid var(--bo-border);
    border-radius: var(--bo-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bo-cat-link {
    text-decoration: none;
    color: var(--bo-text);
    display: block;
}

.bo-cat-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 8px;
}

.bo-subcat-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
    border-top: 1px solid var(--bo-border);
    padding-top: 8px;
}

.bo-subcat-list li {
    margin: 4px 0;
}

.bo-subcat-list a {
    color: var(--bo-muted);
    text-decoration: none;
    font-size: 0.85rem;
}

.bo-subcat-list a:hover {
    color: var(--bo-primary);
}

/* --- Ads Feed --- */
.bo-feed {
    padding: 32px 0;
}

.bo-feed h2 {
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.bo-ad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.bo-ad-card {
    background: var(--bo-card-bg);
    border: 1px solid var(--bo-border);
    border-radius: var(--bo-radius);
    overflow: hidden;
    transition: box-shadow 0.2s;
    position: relative;
}

.bo-ad-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.bo-ad-card-link {
    display: block;
    padding: 16px;
    text-decoration: none;
    color: inherit;
}

.bo-ad-title {
    font-size: 1.1rem;
    margin: 0 0 8px 0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bo-ad-cat {
    font-size: 0.85rem;
    color: var(--bo-muted);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bo-ad-price {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--bo-primary);
    margin: 6px 0;
}

.bo-ad-city {
    font-size: 0.85rem;
    color: var(--bo-muted);
    margin: 4px 0;
}

.bo-ad-date {
    font-size: 0.75rem;
    color: #999;
    margin-top: 8px;
}

.bo-empty {
    text-align: center;
    padding: 40px;
    background: var(--bo-card-bg);
    border: 1px dashed var(--bo-border);
    border-radius: var(--bo-radius);
}

.bo-empty .bo-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background: var(--bo-primary);
    color: #fff;
    text-decoration: none;
    border-radius: var(--bo-radius);
}

.bo-empty .bo-btn:hover {
    background: var(--bo-primary-hover);
}

/* --- Footer --- */
.bo-footer {
    padding: 24px 0;
    text-align: center;
    color: var(--bo-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--bo-border);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .bo-header .bo-container {
        flex-direction: column;
        height: auto;
        padding: 12px 0;
    }
    .bo-nav {
        margin-top: 12px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
    .bo-cat-grid, .bo-ad-grid {
        grid-template-columns: 1fr;
    }
}
