:root {
    --primary: #353A50;
    --accent: #C9AB59;
    --primary-light: #4a5167;
    --accent-light: #d4b66b;
    --accent-dark: #b8984f;
    --bg-light: #f8f9fa;
    --text-dark: #2c3e50;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --shadow: 0 2px 20px rgba(53, 58, 80, 0.1);
    --shadow-lg: 0 8px 32px rgba(53, 58, 80, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-light) 0%, #e3e8f0 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

.search-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.search-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 40px 30px;
    border-radius: 20px 20px 0 0;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.search-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: linear-gradient(45deg, var(--accent), var(--accent-light));
    border-radius: 50%;
    opacity: 0.1;
}

.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    position: relative;
    z-index: 3;
}

.header-content {
    flex: 1;
}

.header-nav-link {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-nav-link:hover {
    background: var(--accent);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 171, 89, 0.3);
}

.search-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
}

.search-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

.debug-info {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: var(--primary);
    padding: 15px 30px;
    font-weight: 600;
    border-left: 5px solid var(--primary);
    box-shadow: var(--shadow);
}

.search-box {
    background: white;
    padding: 30px;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--accent);
}

#search-input {
    width: 100%;
    padding: 18px 25px;
    font-size: 18px;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    transition: all 0.3s ease;
    background: var(--bg-light);
}

#search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(201, 171, 89, 0.1);
    background: white;
}

.search-options {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: center;
}

.search-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-light);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.search-option:hover {
    background: var(--border-color);
}

.search-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.search-option select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-dark);
}

.search-warning {
    display: none;
    background: linear-gradient(135deg, #fff8e1 0%, #fff3c4 100%);
    border: 1px solid var(--accent);
    padding: 20px 30px;
    color: var(--primary);
    border-left: 5px solid var(--accent);
}

.search-warning strong {
    color: var(--primary);
}

.search-stats {
    display: none;
    background: var(--primary);
    color: white;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 500;
}

.search-results {
    background: white;
    border-radius: 0 0 20px 20px;
    box-shadow: var(--shadow-lg);
    min-height: 300px;
    overflow: hidden;
}

.no-search {
    padding: 60px 30px;
    text-align: center;
    color: var(--text-muted);
}

.no-search p:first-child {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.bottom-nav {
    margin-top: 30px;
    text-align: center;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
}

.law-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 20px 30px;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 3px solid var(--accent);
}

.law-header:first-child {
    border-top: none;
}

.search-result {
    border-bottom: 1px solid var(--border-color);
    padding: 25px 30px;
    transition: all 0.2s ease;
}

.search-result:hover {
    background: var(--bg-light);
    border-left: 5px solid var(--accent);
    padding-left: 25px;
}

.search-result:last-child {
    border-bottom: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 20px;
}

.section-header h4 {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.section-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.section-preview {
    background: linear-gradient(135deg, var(--bg-light) 0%, #f1f3f5 100%);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--accent);
    position: relative;
}

.section-preview::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: var(--accent);
    opacity: 0.1;
    border-radius: 0 12px 0 40px;
}

.section-full {
    display: none;
    background: white;
    padding: 25px;
    border: 2px solid var(--accent);
    border-radius: 12px;
    margin-top: 15px;
    box-shadow: var(--shadow);
}

.context-warning {
    background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #28a745;
    color: #155724;
}

.toggle-btn {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: var(--primary);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-btn:hover {
    background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 171, 89, 0.3);
}

.btn-expanded {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%) !important;
    color: white !important;
}

mark {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

a {
    color: var(--accent-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.nav-link {
    display: inline-block;
    margin: 15px 0;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-link:hover {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.section-preview p, .section-full p {
    margin: 0 0 12px 0;
    line-height: 1.7;
}

.section-preview p:last-child, .section-full p:last-child {
    margin-bottom: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .search-container {
        padding: 10px;
    }
    
    .search-header {
        padding: 30px 20px;
        border-radius: 15px 15px 0 0;
    }
    
    .search-header h1 {
        font-size: 2rem;
    }
    
    .search-box {
        padding: 20px;
    }
    
    #search-input {
        font-size: 16px;
        padding: 15px 20px;
    }
    
    .search-options {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .section-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-result {
        padding: 20px 15px;
    }
    
    .search-result:hover {
        padding-left: 10px;
    }
    
    .header-nav {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .header-nav-link {
        align-self: flex-end;
    }
}

/* Focus styles for accessibility */
.toggle-btn:focus,
#search-input:focus,
.nav-link:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}