/* ========================================
   Калачинск Онлайн - Новый дизайн
   Полный файл стилей (Final Version)
   ======================================== */

:root {
    --primary-color: #3B82F6;
    --primary-hover: #2563EB;
    --secondary-color: #10B981;
    --text-dark: #1F2937;
    --text-gray: #6B7280;
    --text-light: #9CA3AF;
    --bg-light: #F3F4F6;
    --bg-page: #F0F2F5;
    --border-color: #E5E7EB;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ========================================
   Header
   ======================================== */
.header {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    flex-shrink: 0;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.5rem 0.875rem;
    color: var(--text-gray);
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    font-weight: 400;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.06);
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 500;
}

.btn-add-org {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.15s;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-add-org:hover {
    background: var(--primary-hover);
}

/* ========================================
   Common Components
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.white-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.white-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.text-center {
    text-align: center;
    margin-top: 1.5rem;
}

.btn-blue {
    background: var(--primary-color);
    color: white;
    padding: 0.625rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.85rem;
    display: inline-block;
    transition: all 0.15s;
    border: none;
    cursor: pointer;
}

.btn-blue:hover {
    background: var(--primary-hover);
}

.btn-outline {
    background: white;
    color: var(--primary-color);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.8rem;
    display: inline-block;
    border: 1.5px solid var(--primary-color);
    transition: all 0.15s;
    cursor: pointer;
}

.btn-outline:hover {
    background: rgba(59, 130, 246, 0.06);
}

/* ========================================
   Hero Slider
   ======================================== */
.hero-slider {
    margin: 0;
    padding: 0;
}

.hero-slider-container {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 420px;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.7s ease-in-out;
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    z-index: 2;
}

.hero-slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.hero-slide-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    width: 100%;
    max-width: 550px;
    z-index: 3;
    padding: 2rem;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    line-height: 1.25;
}

.hero-search {
    background: white;
    padding: 0.375rem;
    border-radius: 50px;
    display: flex;
    gap: 0.25rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    max-width: 450px;
    margin: 0 auto 1rem;
}

.hero-search input {
    flex: 1;
    border: none;
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    outline: none;
    border-radius: 50px;
    font-family: inherit;
    color: var(--text-dark);
}

.hero-search input::placeholder {
    color: var(--text-light);
}

.hero-search button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hero-search button:hover {
    background: var(--primary-hover);
}

.hero-subtitle {
    font-size: 0.8rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.heart {
    color: #EF4444;
    display: inline-block;
}

/* Slider Controls */
.slider-prev,
.slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0;
}

.hero-slider-container:hover .slider-prev,
.hero-slider-container:hover .slider-next {
    opacity: 1;
}

.slider-prev:hover,
.slider-next:hover {
    background: rgba(255, 255, 255, 0.35);
}

.slider-prev { left: 1rem; }
.slider-next { right: 1rem; }

/* Slider Dots */
.slider-dots {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.slider-dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

/* ========================================
   Categories Section
   ======================================== */
.categories-section {
    margin: 1.5rem auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-dark);
}

.categories-count {
    color: var(--text-gray);
    font-size: 0.85rem;
    font-weight: 400;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.75rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 0.5rem;
    border-radius: var(--radius-md);
    color: var(--text-dark);
    transition: all 0.15s;
    background: #F8F9FB;
    border: 1px solid transparent;
}

.category-card:hover {
    background: #EEF1F5;
    border-color: var(--border-color);
    transform: translateY(-2px);
}

.category-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.category-name {
    font-weight: 500;
    font-size: 0.75rem;
    text-align: center;
    line-height: 1.3;
}

.show-all-wrapper {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-show-all {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.375rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.btn-show-all:hover {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.06);
}

/* ========================================
   Companies Section
   ======================================== */
.companies-section {
    margin: 2.5rem auto;
}

.section-subtitle {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.companies-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.company-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.company-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.company-image {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #E8F0FE 0%, #D4E4FC 100%);
    position: relative;
    overflow: hidden;
}

.company-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: white;
    padding: 0.2rem 0.625rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-gray);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    z-index: 2;
}

.company-star {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #FBBF24, #F59E0B);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    z-index: 2;
}

.company-content {
    padding: 1rem;
}

.company-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--primary-color);
    line-height: 1.3;
}

.company-description {
    color: var(--text-gray);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.company-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #F3F4F6;
}

.company-link {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.8rem;
}

.company-link:hover {
    color: var(--primary-color);
}

.company-views {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-light);
    font-size: 0.75rem;
}

/* ========================================
   Ad Banner
   ======================================== */
.ad-banner-section {
    margin: 0 auto;
}

.ad-banner-full {
    width: 100%;
    height: 120px;
    background: var(--primary-color);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.ad-label {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(255,255,255,0.9);
    color: var(--primary-color);
    padding: 0.2rem 0.625rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
}

/* ========================================
   News Section
   ======================================== */
.news-section {
    margin: 2.5rem auto;
}

.news-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    align-items: stretch;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.news-card-horizontal {
    background: white;
    border-radius: var(--radius-md);
    display: flex;
    gap: 1rem;
    padding: 1rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: all 0.15s;
}

.news-card-horizontal:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: #D1D5DB;
}

.news-card-image {
    width: 140px;
    height: 110px;
    background: linear-gradient(135deg, #E8F0FE 0%, #D4E4FC 100%);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    overflow: hidden;
}

.news-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.news-date {
    color: var(--text-light);
    font-size: 0.75rem;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
}

.news-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    line-height: 1.4;
    color: var(--text-dark);
}

.news-card-title a {
    color: var(--primary-color);
    transition: color 0.15s;
}

.news-card-title a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.news-link {
    color: var(--text-gray);
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 0.25rem;
    transition: color 0.15s;
}

.news-link:hover {
    color: var(--primary-color);
}

.news-views {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    color: var(--text-light);
    font-size: 0.7rem;
    margin-top: auto;
    padding-top: 0.25rem;
}

.news-ad-card {
    background: var(--primary-color);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    min-height: 100%;
}

.ad-label-small {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary-color);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ========================================
   Info Blocks
   ======================================== */
.info-sections {
    margin: 2.5rem auto;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.info-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    min-height: 280px;
}

/* Блок "В поисках работы" */
.info-card-work {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.info-card-left {
    flex: 1;
    z-index: 2;
}

.info-card-work h3,
.info-card-about h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    line-height: 1.3;
}

.info-card-work p,
.info-card-about p {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.btn-info-outline {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-sm);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-info-outline:hover {
    background: var(--primary-color);
    color: white;
}

.info-card-right {
    flex-shrink: 0;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Блок "О проекте" с фоновым изображением */
.info-card-about {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.info-card-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    pointer-events: none;
    opacity: 0.6;
}

.info-card-bg-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: right bottom;
}

.info-card-content {
    position: relative;
    z-index: 2;
}

.info-card-about p {
    max-width: 85%;
}

/* ========================================
   All Categories Section
   ======================================== */
.all-categories-section {
    margin: 0 auto 2.5rem;
}

.categories-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.categories-column {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.category-item-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.category-item-link:hover {
    background: #F3F4F6;
}

.category-item-name {
    color: var(--text-dark);
    font-size: 0.8rem;
    font-weight: 400;
}

.category-item-count {
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 400;
}

/* ========================================
   Footer - Точная копия макета
   ======================================== */
.footer {
    background: var(--bg-page);
    padding-top: 3rem;
    padding-bottom: 2rem;
    border-top: 1px solid transparent;
    margin-top: 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Кнопка в футере */
.btn-add-org-footer {
    background: var(--primary-color);
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.btn-add-org-footer:hover {
    background: var(--primary-hover);
}

/* Средняя строка (Почта / Адрес) */
.footer-info-row {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    font-size: 0.85rem;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.footer-info-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.footer-info-item a:hover {
    text-decoration: underline;
}

/* Нижняя строка (Копирайт) */
.footer-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-light);
}

.footer-made-with {
    display: flex;
    align-items: center;
    gap: 4px;
}

.heart {
    color: #EF4444;
    display: inline-block;
    font-size: 1rem;
    line-height: 1;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .companies-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .news-layout {
        grid-template-columns: 1fr;
    }
    
    .news-ad-card {
        order: -1;
        min-height: 150px;
    }
    
    .categories-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0.625rem 1rem;
    }
    
    .nav {
        display: none;
    }
    
    .hero-slider-container {
        height: 320px;
        margin: 0.75rem 0;
        border-radius: var(--radius-md);
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-search {
        flex-direction: column;
        border-radius: var(--radius-md);
    }
    
    .hero-search button {
        width: 100%;
        border-radius: var(--radius-md);
    }
    
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .category-icon {
        width: 44px;
        height: 44px;
    }
    
    .companies-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-columns {
        grid-template-columns: 1fr 1fr;
    }
    
    .news-card-horizontal {
        flex-direction: column;
    }
    
    .news-card-image {
        width: 100%;
        height: 140px;
    }
    
    .slider-prev { left: 0.5rem; }
    .slider-next { right: 0.5rem; }
    
    .container {
        padding: 0 1rem;
    }
    
    /* Footer responsive */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    .footer-col-main {
        grid-column: 1 / -1;
        margin-bottom: 1rem;
    }
    
    .footer-info-row {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .footer-bottom-row {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-col-main {
        text-align: center;
    }
    
    .btn-add-org-footer {
        margin: 0.5rem auto 0;
    }
}