/* judicial-search.css - Стили для поиска судебных актов */

.search-page-container {
    font-family: 'Comfortaa', sans-serif;
    background-color: white;
    min-height: calc(100vh - 140px); /* Учитываем высоту navbar и footer */
    color: #2d3748;
    padding: 20px;
    box-sizing: border-box;
}

.search-page-header {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.search-page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #343a40;
    margin: 0;
    font-family: 'Comfortaa', sans-serif;
}

.mobile-back-btn {
    background: #343a40;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    display: none;
    width: 100%;
    margin-bottom: 15px;
    font-family: 'Comfortaa', sans-serif;
}

.mobile-back-btn:hover {
    background: #495057;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 58, 64, 0.3);
}

/* Desktop Layout */
.desktop-layout {
    display: flex;
    gap: 20px;
    min-height: calc(100vh - 200px);
}

.left-panel {
    width: 350px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.right-panel {
    flex: 1;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

/* Mobile Layout */
.mobile-layout {
    display: none;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    overflow: hidden;
    min-height: calc(100vh - 200px);
    overflow-x: hidden; /* ← добавь явно */
    width: 100%;
    box-sizing: border-box;
}

.mobile-screen {
    display: none;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.mobile-screen.active {
    display: flex;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    font-family: 'Comfortaa', sans-serif;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: #343a40;
    box-shadow: 0 0 0 3px rgba(52, 58, 64, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 18px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #495057;
    flex-wrap: wrap;
}

.breadcrumb-item {
    padding: 6px 12px;
    background: #e9ecef;
    border-radius: 6px;
    color: #343a40;
    font-weight: 500;
}

.list-container {
    flex: 1;
    overflow-y: auto;
}

.list-item {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #343a40;
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

.list-item-subtitle {
    font-size: 14px;
    color: #6c757d;
}

.count-badge {
    background: #343a40;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    margin-left: 12px;
}

/* Desktop specific styles */
.region-item, .city-item, .court-item {
    margin-bottom: 8px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.region-header, .city-header, .court-header {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    transition: all 0.3s ease;
    position: relative;
}

.region-header:hover, .city-header:hover, .court-header:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

.region-header.visited, .city-header.visited, .court-header.visited {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.region-header.active, .city-header.active, .court-header.active {
    background: #343a40;
    color: white;
}

.court-header .count-badge {
    flex-shrink: 0;
    margin-left: 8px;
}

.court-header span:first-child {
    flex: 1;
    min-width: 0;
}

.active .count-badge {
    background: rgba(255, 255, 255, 0.2);
}

.children {
    padding-left: 20px;
    background: #f8f9fa;
    display: none;
    /* max-height: 0; */
    /* overflow: hidden; */
    /* transition: all 0.3s ease; */
}

.children.expanded {
    /* max-height: 1000px; */
    display: block;
    padding: 10px 20px;
}

.expand-icon {
    transition: transform 0.3s ease;
    color: #6c757d;
}

.expanded > .region-header .expand-icon,
.expanded > .city-header .expand-icon {
    transform: rotate(90deg);
}

.results-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.case-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.case-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.case-card.read {
    opacity: 0.7;
    border-left: 4px solid #28a745;
}

.case-card.read .case-number::before {
    content: "✓ ";
    color: green;
}

.case-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.case-info {
    flex: 1;
}

.case-number {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 4px;
}

.case-court {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 8px;
}

.case-date {
    color: #adb5bd;
    font-size: 12px;
}

.case-excerpt {
    line-height: 1.6;
    color: #495057;
}

.highlight {
    background: #fff3cd;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
    color: #856404;
}

.filter-info {
    padding: 12px 16px;
    background: #d1ecf1;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* Scrollbar styles */
.left-panel::-webkit-scrollbar,
.right-panel::-webkit-scrollbar,
.results-container::-webkit-scrollbar,
.list-container::-webkit-scrollbar {
    width: 8px;
}

.left-panel::-webkit-scrollbar-track,
.right-panel::-webkit-scrollbar-track,
.results-container::-webkit-scrollbar-track,
.list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.left-panel::-webkit-scrollbar-thumb,
.right-panel::-webkit-scrollbar-thumb,
.results-container::-webkit-scrollbar-thumb,
.list-container::-webkit-scrollbar-thumb {
    background: #343a40;
    border-radius: 4px;
}

.left-panel::-webkit-scrollbar-thumb:hover,
.right-panel::-webkit-scrollbar-thumb:hover,
.results-container::-webkit-scrollbar-thumb:hover,
.list-container::-webkit-scrollbar-thumb:hover {
    background: #495057;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.case-card, .list-item {
    animation: fadeIn 0.3s ease;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .search-page-container {
        padding: 10px;
    }
    
    .search-page-header {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .search-page-header h1 {
        font-size: 20px;
    }
    
    .desktop-layout {
        display: none;
    }
    
    .mobile-layout {
        display: flex;
    }
    
    .mobile-back-btn {
        display: block;
        padding: 10px 16px;
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .mobile-screen {
        padding: 15px;
    }
    
    .search-input {
        padding: 12px 40px 12px 15px;
        font-size: 16px;
    }
    
    .list-item {
        padding: 12px 15px;
        margin-bottom: 8px;
    }
    
    .list-item-title {
        font-size: 15px;
    }
    
    .list-item-subtitle {
        font-size: 13px;
    }
    
    .count-badge {
        font-size: 11px;
        padding: 4px 8px;
        margin-left: 20px;
        color: black;
    }
}

.case-excerpt em {
    background-color: yellow;
    font-style: normal;
    font-weight: bold;
    padding: 0 2px;
    border-radius: 2px;
}

.search-btn {
    background: white;
    border: none;
    color: black;
    font-size: 18px;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: white;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.search-btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}


.dot {
    width: 12px;
    height: 12px;
    background-color: #3498db;
    animation: blink 1s infinite;
}
.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.1s; }
.dot:nth-child(3) { animation-delay: 0.2s; }
.dot:nth-child(4) { animation-delay: 0.3s; }
.dot:nth-child(5) { animation-delay: 0.4s; }

@keyframes blink {
    0%, 40%, 100% { opacity: 0.2; }
    20% { opacity: 1; }
}