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

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

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: #1e3c72;
    margin-bottom: 10px;
}

.tagline {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-control:focus {
    outline: none;
    border-color: #2a5298;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background-color: #2a5298;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #1e3c72;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.error-message {
    color: #dc3545;
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
}

header {
    background-color: #1e3c72;
    color: white;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

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

.user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.main-nav {
    background-color: #2a5298;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav-btn {
    background: none;
    border: none;
    color: white;
    padding: 15px 30px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-btn.active {
    background-color: #1e3c72;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.content-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.content-section h2 {
    margin-bottom: 20px;
    color: #1e3c72;
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.case-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

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

.case-card h3 {
    color: #2a5298;
    margin-bottom: 10px;
}

.case-meta {
    color: #666;
    font-size: 14px;
}

.upload-area {
    border: 2px dashed #2a5298;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin: 20px 0;
}

.upload-area:hover {
    background-color: #f8f9fa;
}

.upload-area.dragover {
    background-color: #e3f2fd;
    border-color: #1e3c72;
}

.file-list {
    margin: 20px 0;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
}

.file-item button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-fill {
    height: 100%;
    background-color: #2a5298;
    transition: width 0.3s;
    width: 0%;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #1e3c72;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.documents-checklist {
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
}

.document-checkbox {
    display: block;
    margin-bottom: 10px;
}

.status-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    display: none;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

.time-estimate {
    margin-top: 10px;
    color: #666;
    font-style: italic;
}

.analyses-list {
    margin-top: 20px;
}

.analysis-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.analysis-item h4 {
    color: #2a5298;
    margin-bottom: 10px;
}

.analysis-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.analysis-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

/* Analysis Modal Styles */
.analysis-modal {
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 30px;
}

.analysis-title {
    color: #1e3c72;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.analysis-date {
    color: #666;
    font-size: 14px;
}

/* Analysis Content Typography */
.analysis-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.analysis-content .analysis-h1 {
    font-size: 28px;
    color: #1e3c72;
    margin: 30px 0 20px 0;
    font-weight: 700;
    border-bottom: 3px solid #2a5298;
    padding-bottom: 10px;
}

.analysis-content .analysis-h2 {
    font-size: 24px;
    color: #2a5298;
    margin: 25px 0 15px 0;
    font-weight: 600;
}

.analysis-content .analysis-h3 {
    font-size: 20px;
    color: #1e3c72;
    margin: 20px 0 12px 0;
    font-weight: 600;
}

.analysis-content .analysis-h4 {
    font-size: 18px;
    color: #2a5298;
    margin: 15px 0 10px 0;
    font-weight: 500;
}

.analysis-content .analysis-paragraph {
    margin: 0 0 15px 0;
    text-align: justify;
}

.analysis-content strong {
    color: #1e3c72;
    font-weight: 600;
    background-color: #f0f4f8;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Lists */
.analysis-content .analysis-ordered-list,
.analysis-content .analysis-bullet-list {
    margin: 15px 0 20px 0;
    padding-left: 0;
}

.analysis-content .numbered-item,
.analysis-content .bullet-item {
    margin: 8px 0;
    padding-left: 35px;
    position: relative;
    list-style: none;
}

.analysis-content .numbered-item .list-number {
    position: absolute;
    left: 0;
    font-weight: 600;
    color: #2a5298;
}

.analysis-content .bullet-item::before {
    content: "•";
    position: absolute;
    left: 15px;
    color: #2a5298;
    font-weight: bold;
    font-size: 20px;
}

/* Nested lists */
.analysis-content li ul,
.analysis-content li ol {
    margin: 10px 0 10px 20px;
}

/* Emphasis for legal sections */
.analysis-content h3:contains("Violation"),
.analysis-content h3:contains("Finding"),
.analysis-content h3:contains("Conclusion") {
    color: #d32f2f;
}

/* Professional spacing */
.analysis-content > *:first-child {
    margin-top: 0;
}

.analysis-content > *:last-child {
    margin-bottom: 0;
}

/* Modal scrollbar styling */
.analysis-modal::-webkit-scrollbar {
    width: 10px;
}

.analysis-modal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.analysis-modal::-webkit-scrollbar-thumb {
    background: #2a5298;
    border-radius: 5px;
}

.analysis-modal::-webkit-scrollbar-thumb:hover {
    background: #1e3c72;
}

/* Follow-up Questions Styles */
.followup-section {
    margin-top: 40px;
    padding-top: 20px;
}

.followup-header {
    color: #1e3c72;
    font-size: 20px;
    margin-bottom: 20px;
}

.followup-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.followup-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.followup-input:focus {
    outline: none;
    border-color: #2a5298;
}

.followup-history {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.followup-item {
    margin-bottom: 25px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2a5298;
}

.followup-item.loading {
    opacity: 0.7;
    border-left-color: #ffc107;
}

.followup-question {
    font-size: 16px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.followup-date {
    font-size: 12px;
    color: #666;
}

.followup-response {
    margin-top: 10px;
    padding-left: 20px;
}

.followup-meta {
    margin-top: 10px;
    text-align: right;
    color: #666;
}

.loading-spinner {
    color: #2a5298;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.loading-spinner::before {
    content: '⏳ ';
    font-size: 20px;
}

.analysis-divider {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .cases-grid {
        grid-template-columns: 1fr;
    }
    
    .analysis-modal {
        padding: 20px;
    }
    
    .analysis-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .followup-input-container {
        flex-direction: column;
    }
    
    .followup-input {
        width: 100%;
    }
}