/* ========================================
   Городской справочник "Калачинск Онлайн"
   Основные стили
   ======================================== */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1e40af;
    --secondary-color: #3b82f6;
    --vip-color: #dc2626;
    --vip-gradient: linear-gradient(135deg, #dc2626, #a855f7);
    --premium-color: #f59e0b;
    --premium-gradient: linear-gradient(135deg, #f59e0b, #fbbf24);
    --free-color: #6b7280;
    --bg-light: #f8fafc;
    --text-gray: #64748b;
    --text-dark: #1e293b;
    --border-color: #e2e8f0;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    background-color: #ffffff;
    line-height: 1.6;
}

.main-content {
    min-height: calc(100vh - 200px);
}

/* ========================================
   Навигация
   ======================================== */
.navbar {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color) !important;
}

.navbar-brand i {
    font-size: 1.8rem;
    margin-right: 0.5rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
}

/* Компактное меню */
.navbar .btn-success {
    font-size: 0.875rem;
    font-weight: 500;
}

.navbar .form-control-sm {
    font-size: 0.875rem;
}

@media (max-width: 991px) {
    .navbar .btn-success {
        margin-top: 0.5rem;
        width: 100%;
        text-align: center;
    }
    
    .navbar form {
        margin-top: 0.5rem;
        width: 100%;
    }
    
    .navbar form input {
        width: 100% !important;
    }
}

/* ========================================
   Слайдер
   ======================================== */
.hero-slider {
    margin-top: 2rem;
}

.carousel-item {
    height: 400px;
    position: relative;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 1rem;
}

.carousel-caption {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 2rem;
    bottom: 2rem;
    left: 2rem;
    right: 2rem;
}

.carousel-caption h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.carousel-caption p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* ========================================
   Секции
   ======================================== */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* ========================================
   Категории
   ======================================== */
.category-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    cursor: pointer;
    height: 100%;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.category-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

/* ========================================
   Карточки компаний (ТАРИФНЫЕ ПЛАНЫ)
   ======================================== */
.company-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    height: 100%;
    position: relative;
}

.company-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* VIP компании - выделенные */
.company-card.tariff-vip {
    border: 3px solid var(--vip-color);
    background: linear-gradient(to bottom, rgba(220, 38, 38, 0.05), white);
    box-shadow: 0 5px 20px rgba(220, 38, 38, 0.2);
}

.company-card.tariff-vip:hover {
    box-shadow: 0 10px 40px rgba(220, 38, 38, 0.3);
    border-color: #b91c1c;
}

.company-card.tariff-vip .tariff-badge {
    background: var(--vip-gradient);
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Premium компании */
.company-card.tariff-premium {
    border: 2px solid var(--premium-color);
    background: linear-gradient(to bottom, rgba(245, 158, 11, 0.05), white);
    box-shadow: 0 3px 15px rgba(245, 158, 11, 0.15);
}

.company-card.tariff-premium:hover {
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.25);
}

.company-card.tariff-premium .tariff-badge {
    background: var(--premium-gradient);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Free компании - стандартные */
.company-card.tariff-free {
    border: 1px solid var(--border-color);
}

.company-card.tariff-free .tariff-badge {
    background: #f1f5f9;
    color: var(--text-gray);
    font-weight: 500;
    padding: 0.3rem 0.7rem;
    border-radius: 0.4rem;
}

.company-logo {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.company-card.tariff-vip .company-logo {
    height: 250px;
}

.company-card-body {
    padding: 1.5rem;
}

.company-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.company-card.tariff-vip .company-name {
    font-size: 1.5rem;
    background: var(--vip-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.company-description {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.company-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.company-meta i {
    color: var(--primary-color);
}

.company-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-view-company {
    flex: 1;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-view-company:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.company-card.tariff-vip .btn-view-company {
    background: var(--vip-gradient);
}

.company-card.tariff-premium .btn-view-company {
    background: var(--premium-gradient);
}

/* ========================================
   Карточки новостей
   ======================================== */
.news-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-card-body {
    padding: 1.5rem;
}

.news-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.news-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.news-excerpt {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* ========================================
   Карточки объявлений
   ======================================== */
.ad-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    height: 100%;
}

.ad-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.ad-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.ad-card-body {
    padding: 1.5rem;
}

.ad-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.ad-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.ad-contact {
    font-size: 0.95rem;
    color: var(--text-gray);
}

.ad-contact i {
    color: var(--primary-color);
}

/* Детальная страница объявления */
.ad-detail-image {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
}

.ad-detail-image img {
    transition: transform 0.3s ease;
}

.ad-detail-image:hover img {
    transform: scale(1.05);
}

.breadcrumb {
    background: transparent;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.2em;
}

/* ========================================
   Футер
   ======================================== */
.footer {
    background: #1e293b;
}

.text-light-gray {
    color: #94a3b8 !important;
}

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

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* ========================================
   Страницы компаний VIP/Premium
   ======================================== */

/* Заголовки компаний */
.company-header {
    position: relative;
    padding: 20px 0;
}

.vip-header {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05), rgba(168, 85, 247, 0.05));
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.premium-header {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(251, 191, 36, 0.05));
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
}

.tariff-badge-large {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.tariff-badge-large.vip {
    background: linear-gradient(135deg, #dc2626, #a855f7);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.tariff-badge-large.premium {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.company-meta {
    font-size: 1.1rem;
    color: var(--text-gray);
}

/* Карточки VIP */
.vip-card {
    background: linear-gradient(to bottom, rgba(220, 38, 38, 0.02), white);
    border-left: 4px solid;
    border-image: linear-gradient(135deg, #dc2626, #a855f7) 1;
}

.vip-contact-card .card-header {
    background: linear-gradient(135deg, #dc2626, #a855f7) !important;
}

.bg-gradient-vip {
    background: linear-gradient(135deg, #dc2626, #a855f7);
}

/* Услуги и преимущества */
.service-item {
    background: #f8fafc;
    border-radius: 8px;
    transition: all 0.3s;
}

.service-item:hover {
    background: #e2e8f0;
    transform: translateX(5px);
}

.feature-item {
    padding: 12px;
    background: #fff7ed;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.feature-item:hover {
    background: #fed7aa;
    transform: translateX(5px);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* Социальные кнопки */
.btn-whatsapp {
    background: #25D366;
    color: white;
    border: none;
}

.btn-whatsapp:hover {
    background: #20BA5A;
    color: white;
}

.btn-vk {
    background: #0077FF;
    color: white;
    border: none;
}

.btn-vk:hover {
    background: #0066DD;
    color: white;
}

.btn-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
    border: none;
}

.btn-instagram:hover {
    opacity: 0.9;
    color: white;
}

.btn-telegram {
    background: #0088cc;
    color: white;
    border: none;
}

.btn-telegram:hover {
    background: #0077b3;
    color: white;
}

/* Галерея компании */
#companyGallery .carousel-item img {
    border-radius: 15px;
}

/* ========================================
   Кнопка "Опубликовать объявление" в меню
   ======================================== */
.navbar .nav-item a[href="/submit-ad.php"] {
    background: #2563eb !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
}

.navbar .nav-item a[href="/submit-ad.php"]:hover {
    background: #1e40af !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Адаптивность для мобильных */
@media (max-width: 991px) {
    .navbar .nav-item a[href="/submit-ad.php"] {
        margin-top: 0.5rem;
        margin-left: 0 !important;
        display: inline-block;
    }
}

#companyGallery .carousel-caption {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 15px;
}

#companyGallery .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 5px;
}

/* Адаптивность для страниц компаний */
@media (max-width: 991px) {
    .vip-header, .premium-header {
        padding: 20px;
    }
    
    .tariff-badge-large {
        font-size: 1rem;
        padding: 8px 16px;
    }
    
    #companyGallery .carousel-item img {
        height: 300px !important;
    }
}

@media (max-width: 768px) {
    .company-header h1 {
        font-size: 1.8rem !important;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Адаптивность
   ======================================== */
@media (max-width: 768px) {
    .section-title {
        font-size: 1.5rem;
    }
    
    .carousel-item {
        height: 250px;
    }
    
    .carousel-caption h3 {
        font-size: 1.3rem;
    }
    
    .carousel-caption p {
        font-size: 0.9rem;
    }
    
    .company-name {
        font-size: 1.1rem;
    }
    
    .company-card.tariff-vip .company-logo {
        height: 200px;
    }
}

/* ========================================
   Утилиты
   ======================================== */
.bg-primary-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.text-primary-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-primary-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
}

.btn-primary-gradient:hover {
    opacity: 0.9;
    transform: scale(1.05);
}
