/* Base styles */
:root {
    --primary: #CE7762;
    --primary-dark: #B5624E;
    --accent: #CE7762;
    --accent-light: #D89180;
    --success: #48bb78;
    --warning: #ed8936;
    --text: #2d3748;
    --text-light: #718096;
    --bg: #f7fafc;
    --white: #ffffff;
    --black: #0a0a0a;
    --dark: #1a1a1a;
    --gray: #2a2a2a;
    --light-gray: #888;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
}

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

/* Header */
.header {
    background: var(--black);
    color: var(--white);
    padding: 0;
    border-radius: 0;
    margin-bottom: 0;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-link img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 26px;
    font-weight: 700;
    color: var(--accent);
}

.header-nav {
    display: flex;
    gap: 32px;
}

.header-nav a {
    color: var(--white);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
}

.header-nav a:hover {
    color: var(--accent);
}

.header-email {
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.header-email:hover {
    color: var(--white);
}

.header-tg {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.header-tg svg {
    vertical-align: middle;
    flex-shrink: 0;
}

/* Hero section for page title */
.hero {
    background: linear-gradient(135deg, var(--black) 0%, var(--dark) 100%);
    color: var(--white);
    padding: 32px 0;
    text-align: center;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.hero-logo {
    height: 60px;
    width: auto;
    flex-shrink: 0;
}

.hero-text {
    text-align: left;
}

.hero h1 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.2;
}

.hero .subtitle {
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
    color: var(--light-gray);
    opacity: 1;
}

/* Search */
.search-container {
    margin-bottom: 24px;
}

.search-input-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 14px 48px 14px 16px;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(206, 119, 98, 0.2);
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.search-stats {
    margin-top: 8px;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Table - Desktop */
.table-container {
    display: none;
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.restrictions-table {
    width: 100%;
    border-collapse: collapse;
}

.restrictions-table th,
.restrictions-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.restrictions-table th {
    background: linear-gradient(135deg, var(--black) 0%, var(--dark) 100%);
    color: var(--white);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Sticky table header clone (desktop only) */
.sticky-thead-clone {
    position: fixed;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: none;
    pointer-events: none;
    overflow: hidden;
}

.sticky-thead-clone.visible {
    display: block;
}

.sticky-thead-clone .restrictions-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.sticky-thead-clone th {
    background: linear-gradient(135deg, var(--black) 0%, var(--dark) 100%);
    color: var(--white);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.restrictions-table th:first-child {
    border-radius: var(--radius-lg) 0 0 0;
}

.restrictions-table th:last-child {
    border-radius: 0 var(--radius-lg) 0 0;
}

.restrictions-table tbody tr:hover {
    background-color: #f8fafc;
}

.restrictions-table tbody tr.no-data {
    color: var(--text-light);
    font-style: italic;
}

.restrictions-table tbody tr.no-data td {
    opacity: 0.7;
}

/* Document links */
.document-link {
    color: #2563EB;
    text-decoration: none;
}

.document-link:hover {
    text-decoration: underline;
    color: #1D4ED8;
}

.card-document a {
    color: #2563EB;
    text-decoration: none;
}

.card-document a:hover {
    text-decoration: underline;
    color: #1D4ED8;
}

/* Notes links */
.notes-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.85rem;
}

.notes-link:hover {
    text-decoration: underline;
    color: var(--primary);
}

/* Expected dates */
.expected {
    color: var(--text-light);
    font-style: italic;
    display: block;
    white-space: nowrap;
}

.expected::before {
    content: "Ожидается";
    display: block;
}

.expected-dates {
    display: block;
}

/* Not published document */
.not-published {
    color: var(--text-light);
    font-style: italic;
}

/* City sub-rows - indented style */
.restrictions-table tbody tr.city-row {
    background-color: #f8fafc;
}

.restrictions-table tbody tr.city-row td:first-child {
    padding-left: 36px;
}

.restrictions-table tbody tr.city-row .region-code {
    background: #4A4A4A;
    font-size: 0.75rem;
}

.restrictions-table tbody tr.hidden {
    display: none;
}

/* Column widths */
.col-region { min-width: 220px; white-space: nowrap; }
.col-dates { min-width: 140px; }
.col-restrictions { min-width: 100px; }
.col-document { min-width: 200px; max-width: 300px; }
.col-notes { min-width: 120px; }

/* Region cell */
.region-code {
    display: inline-block;
    background: var(--dark);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 8px;
    flex-shrink: 0;
}

.region-name {
    font-weight: 500;
    white-space: nowrap;
}

.col-region {
    white-space: nowrap;
}

/* Map icon */
.map-icon-link {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    transition: transform 0.2s;
    vertical-align: middle;
}

.map-icon-link:hover {
    transform: scale(1.1);
}

.map-icon {
    width: 24px;
    height: 24px;
}

.map-icon path {
    fill: #4285f4;
}

.map-icon-link:hover .map-icon path {
    fill: #1a73e8;
}

/* Status indicators */
.status-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 4px;
    vertical-align: middle;
}

.status-ok {
    color: var(--success);
}

.status-pending {
    color: var(--warning);
}

/* Document cell */
.document-text {
    font-size: 0.875rem;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cards - Mobile */
.cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.region-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.region-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.region-card.no-data {
    opacity: 0.7;
    border-left: 4px solid var(--warning);
}

.region-card.has-data {
    border-left: 4px solid var(--success);
}

.region-card.hidden {
    display: none;
}

/* City cards - indented style */
.region-card.city-card {
    margin-left: 10px;
    margin-right: 10px;
    background: #f8fafc;
    border-left-width: 3px;
}

.region-card.city-card .card-code {
    background: var(--text-light);
    font-size: 0.75rem;
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.card-code {
    background: var(--dark);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.875rem;
    margin-right: 12px;
}

.card-region-name {
    font-weight: 600;
    font-size: 1rem;
    flex: 1;
}

.card-header .map-icon-link {
    margin-left: 0;
    margin-right: 8px;
}

.card-status {
    font-size: 1.25rem;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-row {
    display: flex;
    flex-wrap: wrap;
}

.card-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.05em;
    width: 100%;
    margin-bottom: 2px;
}

.card-value {
    font-size: 0.9375rem;
    color: var(--text);
}

.card-value.pending {
    color: var(--warning);
    font-style: italic;
}

.card-document {
    font-size: 0.8125rem;
    color: var(--text-light);
    line-height: 1.4;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.card-document a {
    color: var(--primary);
    text-decoration: none;
}

.card-document a:hover {
    text-decoration: underline;
}

.card-notes {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.card-notes .card-value {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.card-notes a {
    color: var(--text-light);
    text-decoration: none;
}

.card-notes a:hover {
    text-decoration: underline;
    color: var(--primary);
}

/* Legal & Info sections */
.legal-section,
.info-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-top: 32px;
}

.legal-section h2,
.info-section h2 {
    font-size: 1.25rem;
    color: var(--dark);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
}

.info-section h3 {
    font-size: 1rem;
    color: var(--dark);
    margin: 20px 0 8px;
}

.info-section h3:first-of-type {
    margin-top: 0;
}

.legal-section p,
.info-section p {
    margin-bottom: 12px;
    color: var(--text);
}

.info-section ul {
    margin: 8px 0 16px 24px;
}

.info-section li {
    margin-bottom: 4px;
}

/* Footer */
.footer {
    background: var(--black);
    color: var(--white);
    padding: 60px 0 30px;
    margin-top: 32px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-about h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-about h4 span {
    color: var(--accent);
}

.footer-about p {
    font-size: 14px;
    color: var(--light-gray);
    line-height: 1.7;
}

.footer-links h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--light-gray);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-highlight {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 8px;
}

.footer-bottom {
    border-top: 1px solid var(--gray);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--light-gray);
}

.footer-bottom a {
    color: var(--accent);
    text-decoration: none;
}

.footer-bottom a:hover {
    color: var(--white);
}

@media (max-width: 968px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 640px) {
    .header-row {
        flex-direction: column;
        gap: 16px;
    }

    .header-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px 24px;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-text {
        text-align: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* Desktop breakpoint */
@media (min-width: 769px) {
    .container {
        padding: 24px;
    }

    /* Sticky header */
    .header {
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .table-container {
        display: block;
        overflow-x: auto;
    }

    .table-container {
        display: block;
    }

    .cards-container {
        display: none;
    }

    .search-container {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .search-input-wrapper {
        flex: 0 1 500px;
    }

    .search-stats {
        margin-top: 0;
        white-space: nowrap;
    }

    .legal-section,
    .info-section {
        padding: 32px;
    }

    .legal-section h2,
    .info-section h2 {
        font-size: 1.5rem;
    }

    .info-section h3 {
        font-size: 1.125rem;
    }
}

/* Large desktop */
@media (min-width: 1024px) {
    .restrictions-table th,
    .restrictions-table td {
        padding: 16px 20px;
    }
}

/* Accessibility - Visually hidden */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Breadcrumb navigation */
.breadcrumb {
    margin-bottom: 16px;
    font-size: 0.875rem;
}

.breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: "›";
    margin-left: 8px;
    color: var(--text-light);
}

.breadcrumb a {
    color: #2563EB;
    text-decoration: none;
}

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

.breadcrumb li:last-child span {
    color: var(--text-light);
}

/* Mark/highlight styling */
mark {
    background: linear-gradient(120deg, #fef08a 0%, #fde047 100%);
    padding: 0 4px;
    border-radius: 2px;
}

/* Definition term styling */
dfn {
    font-style: normal;
    font-weight: 600;
}

/* Footer link */
.footer a {
    color: var(--text-light);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
    color: var(--text);
}

/* Print styles */
@media print {
    .search-container,
    .legal-section,
    .info-section,
    .footer {
        display: none;
    }

    .table-container {
        display: block !important;
        box-shadow: none;
    }

    .cards-container {
        display: none !important;
    }

    .restrictions-table th {
        background: #333;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
