/* Typography System */
body {
    font-family: 'Century';
    line-height: 1.7;
    color: #333; /* 333 */
    background-color: #043b6e; /*7995b1   #5a9fdf*/
}

h1, h2, h3 {
    font-family: 'Century';
    font-weight: bold;
    font-size: 1.1rem;
}

.logo {
    font-family: 'Poiret One', sans-serif;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #e2e8f0;
    display: inline-block;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 2px;
    margin-top: 1rem;
}

.nav-links {
    font-family: 'Poiret One';
    font-size: 1.1rem;
    letter-spacing: 0.15em;
}

p {
    font-family: 'Century';
    font-weight: 400;
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Color Strategy - 60-30-10 rule */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --background-light: #f8f9fa;
    --background-medium: #e2e8f0;
    --text-dark: #1e293b; /*dark: #1e293b medium: 475569 light: 94a3b8*/
    --text-medium: #475569;
    --text-light: #94a3b8;
    --neon-green: #39ff14;
}


.text-subtitle {
    color: #e2e8f0;
    letter-spacing: 0.05em;
    font-size: 1.2rem;
}


/* Layout Enhancements */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Card design - Neumorphism style */
.neu-card {
    background: var(--background-light);
    border-radius: 1rem;
    box-shadow: 
        0.5rem 0.5rem 1rem rgba(0, 0, 0, 0.05),
        -0.5rem -0.5rem 1rem rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.neu-card:hover {
    box-shadow: 
        0.3rem 0.3rem 0.6rem rgba(0, 0, 0, 0.1),
        -0.3rem -0.3rem 0.6rem rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

/* Interactive Elements */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-family: 'Poiret One', cursive;
    letter-spacing: 0.1em;
    font-weight: bold;
    transition: all 0.2s ease;
    min-height: 44px; /* Accessibility: minimum touch target */
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* REPLACED SEARCH BAR - Chat Interface Style */
.search-container {
    position: relative;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.input-container {
    width: 100%;
    position: relative;
    background-color: var(--primary-color);
    border-radius: 24px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.input-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--primary-color);
    border-radius: 20px;
    padding: 12px 16px;
    gap: 12px;
}

.plus-icon {
    width: 30px;
    height: 30px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.plus-icon:hover {
    opacity: 1;
}

.plus-icon svg {
    width: 100%;
    height: 100%;
    fill: var(--background-light);
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    border-radius: 0.75rem;
    border: px solid var(--background-medium);
    background: var(--background-light);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    min-height: 44px; /* Accessibility */
}

.search-input::placeholder {
    color: var(--text-dark);
}

.search-input:hover {
    background-color: var(--background-medium);
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.icon-button {
    width: 20px;
    height: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-button:hover {
    opacity: 1;
}

.icon-button svg {
    width: 100%;
    height: 100%;
    fill: var(--background-light);
}

.search-button {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Results styling */
.result-card {
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.result-meta {
    color: var(--text-medium);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.html-content {
    color: var(--text-medium);
    margin-bottom: 1.5rem;
}

.result-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-btn {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.page-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.page-btn:not(.active) {
    background-color: white;
    color: var(--text-medium);
}

.page-btn:not(.active):hover {
    background-color: var(--background-medium);
}

/* Modal enhancements */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.modal.active .modal-content {
    transform: translateY(0);
}


.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--background-medium);
}

.modal-body {
    padding: 2rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-medium);
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background-color: var(--background-medium);
    color: var(--text-dark);
}

/* Toast notification for errors */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateY(100px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
}

.toast.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-success {
    border-left: 4px solid #10b981;
}

/* Loading indicators */
.loader {
    display: none;
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--background-medium);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .result-card {
        padding: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }
    
    .result-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* Fix for result-title */
.result-title, h3.result-title {
    font-family: 'Century' !important;
    font-weight: bold !important;
    font-size: 1.5rem !important;
    color: var(--text-dark) !important;
    margin-bottom: 0.5rem !important;
}

/* Fix for modal-title */
#modalTitle, .modal-header h2 {
    font-family: 'Century' !important;
    font-weight: bold !important;
    font-size: 1.5rem !important;
    color: var(--text-dark) !important;
}

/* Fix for chunk-content */
#law-chunk, .chunk-content, div.prose {
    font-family: 'Century' !important;
    font-weight: 400 !important;
    font-size: 1.1rem !important;
    line-height: 1.7 !important;
    color: var(--text-medium) !important;
}

/* Fix for paragraphs inside law content */
#law-chunk p, .chunk-content p, div.prose p {
    font-family: 'Century' !important;
    font-weight: 400 !important;
    font-size: 1.1rem !important;
    line-height: 1.7 !important;
}