/**
 * Стили для доски объявлений
 * 
 * @package GS
 * @since 1.0.0
 */

/* ==========================================================================
   ЗАГОЛОВОК СТРАНИЦЫ
   ========================================================================== */

.classifieds-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
    border-bottom: 1px solid var(--border-color);
}

.classifieds-header .page-title {
    font-size: 2.5em;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.classifieds-header .page-description {
    font-size: 1.2em;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.classifieds-actions {
    margin-top: 20px;
}

/* ==========================================================================
   ФИЛЬТРЫ
   ========================================================================== */

.classifieds-filters {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-width: 150px;
}

/* ==========================================================================
   СЕТКА ОБЪЯВЛЕНИЙ
   ========================================================================== */

.classifieds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.classified-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.classified-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.classified-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.classified-title {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    line-height: 1.3;
}

.classified-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.classified-title a:hover {
    color: var(--accent-color);
}

.classified-category {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Цвета категорий */
.category-prodam {
    background: #e8f5e8;
    color: #2d5f2d;
}

.category-kuplyu {
    background: #e8f0ff;
    color: #1a4faa;
}

.category-sdam {
    background: #fff5e8;
    color: #b8600a;
}

.category-uslugi {
    background: #f0e8ff;
    color: #6a2c9a;
}

.category-drugoe {
    background: #f5f5f5;
    color: #555;
}

.classified-content {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 15px;
}

.classified-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9em;
}

.classified-phone a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.classified-phone a:hover {
    text-decoration: underline;
}

.classified-date {
    color: var(--text-tertiary);
    font-size: 0.85em;
}

/* ==========================================================================
   ОТДЕЛЬНОЕ ОБЪЯВЛЕНИЕ
   ========================================================================== */

.classified-single {
    max-width: 800px;
    margin: 0 auto;
}

.breadcrumbs {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.breadcrumbs a {
    color: var(--accent-color);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.classified-single .classified-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.classified-single .classified-title {
    font-size: 2.2em;
    margin-bottom: 15px;
}

.classified-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.classified-single .classified-content {
    font-size: 1.1em;
    line-height: 1.7;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.classified-contact {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: center;
}

.contact-info h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.phone-link {
    display: inline-block;
    font-size: 1.3em;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.phone-link:hover {
    background: var(--accent-color);
    color: white;
}

.classified-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

/* ==========================================================================
   ПОХОЖИЕ ОБЪЯВЛЕНИЯ
   ========================================================================== */

.related-classifieds {
    border-top: 1px solid var(--border-color);
    padding-top: 40px;
}

.related-classifieds h3 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.classified-card-small {
    padding: 15px;
}

.classified-card-small .classified-title {
    font-size: 1em;
    margin-bottom: 10px;
}

.classified-excerpt {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* ==========================================================================
   МОДАЛЬНОЕ ОКНО
   ========================================================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   ФОРМА ОБЪЯВЛЕНИЯ
   ========================================================================== */

.classified-form {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.char-counter {
    text-align: right;
    font-size: 0.85em;
    color: var(--text-tertiary);
    margin-top: 5px;
}

.form-notice {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.form-notice p {
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-notice ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
}

.form-notice li {
    margin-bottom: 5px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* ==========================================================================
   КНОПКИ
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: #c5670b;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--hover-bg);
}

.btn-outline {
    background: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.btn-outline:hover {
    background: var(--accent-color);
    color: white;
}

/* ==========================================================================
   ПАГИНАЦИЯ
   ========================================================================== */

.classifieds-pagination {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 20px;
}

.page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 5px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.page-numbers:hover,
.page-numbers.current {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* ==========================================================================
   ОТСУТСТВИЕ ОБЪЯВЛЕНИЙ
   ========================================================================== */

.no-classifieds {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-classifieds h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.no-classifieds p {
    margin-bottom: 30px;
    font-size: 1.1em;
}

/* ==========================================================================
   ТЕМНАЯ ТЕМА
   ========================================================================== */

body.dark-theme .category-prodam {
    background: #1a3d1a;
    color: #7fd67f;
}

body.dark-theme .category-kuplyu {
    background: #1a2e4a;
    color: #6bb6ff;
}

body.dark-theme .category-sdam {
    background: #4a3a1a;
    color: #ffb366;
}

body.dark-theme .category-uslugi {
    background: #3d1a4a;
    color: #bb7fff;
}

body.dark-theme .category-drugoe {
    background: #2a2a2a;
    color: #ccc;
}

/* ==========================================================================
   АДАПТИВНОСТЬ
   ========================================================================== */

@media (max-width: 768px) {
    .classifieds-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .classified-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .classified-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group select {
        min-width: auto;
    }
    
    .classified-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .classified-meta {
        flex-direction: column;
        gap: 10px;
    }
}