/* Common Styles for ОТБОР.РФ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* Header */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo .highlight {
    color: #3498db;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 8px;
    background: #3498db;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #2980b9;
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #3498db;
}

/* Breadcrumbs */
.breadcrumbs {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    color: #666;
}

.breadcrumbs a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

/* Main Layout */
.main-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 30px;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
}

/* Left Menu */
.left-menu {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    height: fit-content;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.menu-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
}

.menu-item {
    display: block;
    color: #666;
    text-decoration: none;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.menu-item:hover {
    color: #3498db;
    transform: translateX(5px);
}

.menu-item.active {
    color: #3498db;
    font-weight: 600;
}

.menu-item:last-child {
    border-bottom: none;
}

/* Main Content */
.main-content {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #2c3e50;
}

.page-subtitle {
    color: #666;
    font-size: 18px;
    margin-bottom: 40px;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.category-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 2px solid #e1e8ed;
    border-radius: 16px;
    padding: 30px 25px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.1), transparent);
    transition: left 0.6s ease;
}

.category-card:hover::before {
    left: 100%;
}

.category-card:hover {
    transform: translateY(-8px);
    border-color: #3498db;
    box-shadow: 0 15px 40px rgba(52, 152, 219, 0.15);
}

.category-icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

.category-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #2c3e50;
}

.category-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-content p {
    margin: 8px 0;
    font-size: 14px;
}

.footer-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px !important;
    margin-top: 10px !important;
}

/* Comparison Components */
.categories-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-btn {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 25px;
    padding: 10px 20px;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    cursor: pointer;
}

.tab-btn:hover, .tab-btn.active {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-color: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.comparison-section {
    margin-top: 30px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
}

/* Device Cards */
.device-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.device-card {
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.device-card:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.15);
}

.device-card.selected {
    border-color: #3498db;
    background: linear-gradient(135deg, #f8f9fa 0%, rgba(52, 152, 219, 0.05) 100%);
}

.device-image {
    width: 40px;
    height: 60px;
    background: #f8f9fa;
    border-radius: 6px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.device-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
    font-size: 13px;
    line-height: 1.2;
}

.device-brand {
    font-size: 11px;
    color: #666;
    margin-bottom: 5px;
}

.device-price {
    color: #3498db;
    font-weight: 600;
    font-size: 13px;
}

/* Filters */
.filters-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid rgba(52, 152, 219, 0.1);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #2c3e50;
    font-size: 13px;
}

.filter-select {
    padding: 8px 10px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    background: white;
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
    height: 36px;
}

.filter-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.clear-filters-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: 2px solid #c0392b;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-end;
    height: 36px;
    margin-top: 20px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.clear-filters-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

@media (max-width: 768px) {
    .filters-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .filters-section {
        padding: 12px 15px;
    }
}

/* Show More Button */
.show-more-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.show-more-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.show-more-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f6391 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.show-more-btn:disabled {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Enhanced Filters */
.filter-range {
    display: flex;
    gap: 5px;
    align-items: center;
}

.filter-range input {
    width: 70px;
    padding: 6px 8px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
}

.filter-range span {
    color: #666;
    font-size: 14px;
}

.compare-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px 10px 20px 0;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.compare-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f6391 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.compare-btn:disabled {
    background: linear-gradient(135deg, #27ae60 0%, #219a52 100%);
    cursor: pointer;
    transform: none;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    color: white;
}

.compare-btn:disabled:hover {
    background: linear-gradient(135deg, #219a52 0%, #1e8449 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.view-single-btn {
    background: linear-gradient(135deg, #27ae60 0%, #219a52 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.view-single-btn:hover {
    background: linear-gradient(135deg, #219a52 0%, #1e8449 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.view-single-btn:disabled {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Comparison Tables */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px auto;
    background: #fff;
    box-shadow: 0 4px 25px rgba(52, 152, 219, 0.15);
    border-radius: 12px;
    overflow: hidden;
    table-layout: fixed;
    max-width: 1200px;
}

.comparison-table th,
.comparison-table td {
    padding: 15px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(52, 152, 219, 0.1);
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    vertical-align: top;
}

.comparison-table th {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 70px;
    z-index: 10;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.comparison-table th:first-child {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    width: 180px;
    padding: 15px;
    font-weight: 700;
}

.comparison-table tbody tr:nth-child(even) {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.02) 0%, rgba(52, 152, 219, 0.05) 100%);
}

.comparison-table tbody tr:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08) 0%, rgba(52, 152, 219, 0.12) 100%);
    transform: translateX(2px);
    transition: all 0.3s ease;
}

.comparison-table .spec-category td {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%) !important;
    font-weight: 700;
    color: #2c3e50;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    border-top: 2px solid #e67e22;
    border-bottom: 2px solid #e67e22;
    text-shadow: 0 1px 2px rgba(255,255,255,0.3);
}

.comparison-table .spec-category td:first-child {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%) !important;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Адаптивная ширина для разного количества устройств */
.comparison-table.devices-1 {
    max-width: 600px;
}

.comparison-table.devices-1 th:not(:first-child),
.comparison-table.devices-1 td:not(:first-child) {
    width: calc(100% - 180px);
    text-align: center;
}

.comparison-table.devices-2 {
    max-width: 800px;
}

.comparison-table.devices-2 th:not(:first-child),
.comparison-table.devices-2 td:not(:first-child) {
    width: calc((100% - 180px) / 2);
    text-align: center;
}

.comparison-table.devices-3 {
    max-width: 1000px;
}

.comparison-table.devices-3 th:not(:first-child),
.comparison-table.devices-3 td:not(:first-child) {
    width: calc((100% - 180px) / 3);
    text-align: center;
}

.comparison-table.devices-4 th:not(:first-child),
.comparison-table.devices-4 td:not(:first-child) {
    width: calc((100% - 180px) / 4);
}

/* Центрирование данных в ячейках для лучшей читаемости */
.comparison-table th:not(:first-child) {
    text-align: center;
}

.comparison-table td:not(:first-child) {
    text-align: center;
    font-weight: 500;
}

@media (max-width: 768px) {
    .comparison-table {
        font-size: 12px;
    }
    
    .comparison-table th:first-child {
        width: 140px;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 10px 8px;
    }
    
    .comparison-table.devices-1 {
        max-width: 100%;
    }
    
    .comparison-table.devices-1 th:not(:first-child),
    .comparison-table.devices-1 td:not(:first-child) {
        width: calc(100% - 140px);
    }
    
    .comparison-table.devices-2 {
        max-width: 100%;
    }
    
    .comparison-table.devices-2 th:not(:first-child),
    .comparison-table.devices-2 td:not(:first-child) {
        width: calc((100% - 140px) / 2);
    }

    .comparison-table.devices-3 th:not(:first-child),
    .comparison-table.devices-3 td:not(:first-child) {
        width: calc((100% - 140px) / 3);
    }

    .comparison-table.devices-4 th:not(:first-child),
    .comparison-table.devices-4 td:not(:first-child) {
        width: calc((100% - 140px) / 4);
    }
}

.spec-category {
    background: #f8f9fa !important;
    font-weight: 600;
    color: #2c3e50;
}

.spec-better {
    background: rgba(46, 204, 113, 0.1);
    color: #27ae60;
    font-weight: 600;
}

.spec-worse {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* Pros and Cons Section */
.pros-cons-section {
    margin-top: 40px;
}

.pros-cons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.device-analysis {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.device-analysis h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
}

.pros-cons-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.pros, .cons {
    padding: 20px;
    border-radius: 8px;
}

.pros {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.05) 0%, rgba(46, 204, 113, 0.1) 100%);
    border-left: 4px solid #27ae60;
}

.cons {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.05) 0%, rgba(231, 76, 60, 0.1) 100%);
    border-left: 4px solid #e74c3c;
}

.pros h4, .cons h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pros h4 {
    color: #27ae60;
}

.cons h4 {
    color: #e74c3c;
}

.pros ul, .cons ul {
    list-style: none;
}

.pros li, .cons li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    font-size: 14px;
    line-height: 1.5;
}

.pros li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}

.cons li::before {
    content: "✗";
    position: absolute;
    left: 0;
    color: #e74c3c;
    font-weight: bold;
}

.rating-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.rating-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    gap: 15px;
}

.rating-label {
    flex: 1;
    min-width: 120px;
    font-weight: 500;
}

.rating-bar {
    flex: 1;
    max-width: 120px;
    height: 10px;
    background: #e1e8ed;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.rating-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s ease;
}

.rating-value {
    min-width: 45px;
    text-align: right;
    font-weight: 600;
    color: #2c3e50;
}

/* Single Device View */
.single-device-view {
    margin-top: 40px;
    display: none;
}

.single-device-card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    max-width: 800px;
    margin: 0 auto;
}

.single-device-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e1e8ed;
}

.single-device-name {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.single-device-price {
    font-size: 24px;
    color: #3498db;
    font-weight: 600;
}

.single-device-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.spec-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.spec-group h4 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e1e8ed;
}

.spec-item:last-child {
    border-bottom: none;
}

.spec-label {
    font-weight: 500;
    color: #666;
}

.spec-value {
    color: #2c3e50;
    font-weight: 600;
}

@media (max-width: 768px) {
    .single-device-specs {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .single-device-card {
        padding: 20px;
    }
}
@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 200px 1fr;
        gap: 20px;
    }
}

@media (max-width: 968px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .left-menu {
        display: none;
    }
    
    .search-bar {
        margin: 0 20px;
    }
    
    .nav-links {
        display: none;
    }
    
    .pros-cons-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .device-selector {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        padding: 0 15px;
    }
    
    .main-content {
        padding: 25px;
    }
    
    .comparison-table {
        font-size: 14px;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 10px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
}