/* Professional Styles for AI Landscape Analyzer */

* {
    transition: all 0.3s ease;
}

body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #001437 0%, #1A2C4C 50%, #2A4068 100%);
    padding: 4rem 0 3rem 0;
    margin-bottom: 3rem;
    box-shadow: 0 8px 32px rgba(0, 20, 55, 0.2);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(95,182,219,0.1)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-section h1 {
    color: white;
    font-weight: 700;
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.hero-section .lead {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    position: relative;
    z-index: 1;
}

.brand-primary {
    color: #001437;
    font-weight: 600;
}

/* Modern Card Styles */
.modern-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 20, 55, 0.08);
    border: 1px solid rgba(0, 20, 55, 0.06);
    transition: all 0.3s ease;
    overflow: hidden;
}

.modern-card:hover {
    box-shadow: 0 15px 50px rgba(0, 20, 55, 0.12);
    transform: translateY(-2px);
}

.modern-card .card-body {
    padding: 2.5rem;
}

/* Form Enhancements */
.form-label {
    font-weight: 600;
    color: #001437;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.form-control,
.form-select {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:hover,
.form-select:hover {
    border-color: #5FB6DB;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* API Configuration Pills */
.nav-pills .nav-link {
    border-radius: 10px;
    padding: 0.6rem 1.25rem;
    font-weight: 500;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    color: #6c757d;
    background: #f8f9fa;
    border: 2px solid transparent;
}

.nav-pills .nav-link:hover {
    background: rgba(95, 182, 219, 0.1);
    color: #001437;
    border-color: #5FB6DB;
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, #001437 0%, #1A2C4C 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 20, 55, 0.2);
}

/* Submit Button Enhancement */
.btn-analyze {
    background: linear-gradient(135deg, #001437 0%, #1A2C4C 100%);
    border: none;
    border-radius: 12px;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 8px 20px rgba(0, 20, 55, 0.25);
    transition: all 0.3s ease;
}

.btn-analyze:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 20, 55, 0.35);
    background: linear-gradient(135deg, #1A2C4C 0%, #2A4068 100%);
}

.btn-analyze:active {
    transform: translateY(-1px);
}

/* Debug Mode Checkbox */
.form-check {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.form-check:has(.form-check-input:checked) {
    background: rgba(95, 182, 219, 0.1);
    border-color: #5FB6DB;
}

.metric-card {
    padding: 2rem;
    background: linear-gradient(135deg, #001437 0%, #1A2C4C 100%);
    border-radius: 16px;
    color: white;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 20, 55, 0.2);
    margin-bottom: 1.5rem;
    border: none;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(95, 182, 219, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 20, 55, 0.3);
}

.metric-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #5FB6DB;
    text-shadow: 0 2px 10px rgba(95, 182, 219, 0.3);
    position: relative;
    z-index: 1;
}

.chart-container {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 20, 55, 0.08);
    border: 1px solid rgba(0, 20, 55, 0.06);
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.chart-container h5 {
    color: #001437;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #5FB6DB;
    padding-bottom: 0.75rem;
}

.domain-item {
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.domain-item:hover {
    box-shadow: 0 2px 8px rgba(0, 20, 55, 0.1);
    border-color: #5FB6DB;
}

.domain-bar {
    transition: width 0.8s ease;
    background: linear-gradient(90deg, #001437 0%, #5FB6DB 100%) !important;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulsing {
    animation: pulse 1.5s ease-in-out infinite;
}

.progress-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #dee2e6;
}

.progress-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    background: #dee2e6;
    position: relative;
}

.progress-dot {
    width: 12px;
    height: 12px;
    background: #6c757d;
    border-radius: 50%;
}

.progress-icon.loading .progress-dot {
    background: #5FB6DB;
}

.progress-icon.success {
    background: #198754;
}

.progress-icon.success .progress-dot {
    background: white;
}

.progress-icon.error {
    background: #dc3545;
}

.progress-icon.error .progress-dot {
    background: white;
}

.card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 20, 55, 0.06);
}

.card-header {
    background-color: #001437;
    color: white;
    font-weight: 600;
    border-bottom: none;
}

.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    color: #1A2C4C;
    font-weight: 500;
    border: none;
    border-bottom: 3px solid transparent;
}

.nav-tabs .nav-link.active {
    color: #001437;
    background: none;
    border-bottom: 3px solid #5FB6DB;
}

.nav-tabs .nav-link:hover {
    color: #5FB6DB;
    border-bottom: 3px solid #5FB6DB;
}

.alert {
    border-radius: 6px;
    border: none;
}

.alert-info {
    background-color: rgba(95, 182, 219, 0.1);
    color: #001437;
    border-left: 4px solid #5FB6DB;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: #001437;
    border-left: 4px solid #198754;
}

.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

.progress {
    background-color: #e9ecef;
    border-radius: 6px;
}

.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #001437;
    border-color: #001437;
}

.btn-primary:hover {
    background-color: #1A2C4C;
    border-color: #1A2C4C;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 20, 55, 0.2);
}

.btn-outline-secondary {
    color: #1A2C4C;
    border-color: #dee2e6;
}

.btn-outline-secondary:hover {
    background-color: #1A2C4C;
    border-color: #1A2C4C;
    color: white;
}

.form-control:focus,
.form-select:focus {
    border-color: #5FB6DB;
    box-shadow: 0 0 0 0.2rem rgba(95, 182, 219, 0.25);
}

.spinner-border {
    color: #5FB6DB;
}

/* Global Loading Overlay */
.global-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 20, 55, 0.97) 0%, rgba(26, 44, 76, 0.97) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loading-content {
    text-align: center;
    color: white;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    border: 2px solid rgba(95, 182, 219, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 500px;
    backdrop-filter: blur(20px);
}

.spinner-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.spinner-large {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(95, 182, 219, 0.2);
    border-top-color: #5FB6DB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h4 {
    color: white;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.loading-content .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 1rem;
}

.loading-content .progress {
    background-color: rgba(255, 255, 255, 0.15);
    margin: 1.5rem auto 1rem;
    border-radius: 10px;
    overflow: hidden;
    height: 8px;
}

.loading-content .progress-bar {
    background: linear-gradient(90deg, #5FB6DB 0%, #059669 100%);
    transition: width 0.5s ease;
}

/* Modal Improvements */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 20, 55, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, #001437 0%, #1A2C4C 100%);
    color: white;
    border-radius: 16px 16px 0 0;
    padding: 1.5rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 2px solid #f8f9fa;
    padding: 1.5rem 2rem;
}

/* Query Selection Cards */
.query-card {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
}

.query-card:hover {
    border-color: #5FB6DB;
    box-shadow: 0 4px 12px rgba(95, 182, 219, 0.15);
    transform: translateX(5px);
}

.query-card.selected {
    border-color: #5FB6DB;
    background: rgba(95, 182, 219, 0.05);
}

.query-card input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Progress Items Enhancement */
.progress-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    margin-bottom: 0.75rem;
    background: white;
    border-radius: 12px;
    border-left: 4px solid #dee2e6;
    transition: all 0.3s ease;
}

.progress-item.active {
    border-left-color: #5FB6DB;
    background: rgba(95, 182, 219, 0.05);
    box-shadow: 0 2px 8px rgba(95, 182, 219, 0.15);
}

.progress-item.completed {
    border-left-color: #059669;
}

.progress-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    background: #e9ecef;
    position: relative;
    transition: all 0.3s ease;
}

.progress-icon.loading {
    background: rgba(95, 182, 219, 0.2);
}

.progress-icon.loading .progress-dot {
    background: #5FB6DB;
    animation: pulse 1.5s ease-in-out infinite;
}


/* Results Container Modern Layout */
#resultsContainer {
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tab Navigation Enhancement */
.nav-tabs .nav-link {
    font-weight: 500;
    padding: 1rem 1.5rem;
    color: #6c757d;
    border: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: #001437;
    border-bottom-color: rgba(95, 182, 219, 0.5);
}

.nav-tabs .nav-link.active {
    color: #001437;
    font-weight: 600;
    border-bottom-color: #5FB6DB;
    background: none;
}

/* Chart Container Enhancement */
.chart-container {
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Alert/Info Box Modernization */
.alert-info {
    border-radius: 12px;
    border: 2px solid rgba(95, 182, 219, 0.3);
}

.alert-info h6 {
    color: #001437;
    font-weight: 600;
}

/* Badge Enhancements */
.badge {
    padding: 0.5em 0.9em;
    font-weight: 500;
    border-radius: 8px;
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .metric-card {
        margin-bottom: 1rem;
    }
    
    .btn-analyze {
        width: 100%;
    }
}

/* Floating Action Button for New Query */
.floating-action-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border: none;
    border-radius: 50px;
    padding: 16px 28px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(95, 182, 219, 0.4);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.floating-action-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(95, 182, 219, 0.6);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
}

.floating-action-button:active {
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .floating-action-button {
        bottom: 20px;
        right: 20px;
        padding: 14px 24px;
        font-size: 14px;
    }
}

/* Executive Summary Formatting */
.executive-summary-content {
    font-size: 0.95rem;
    line-height: 1.7;
}

.executive-summary-content p {
    margin-bottom: 0.75rem;
}

.executive-summary-content ul {
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
}

.executive-summary-content li {
    margin-bottom: 0.35rem;
}

.executive-summary-content strong {
    color: var(--accent-blue, #5FB6DB);
}

/* Dark background version */
.executive-summary-dark p,
.executive-summary-dark li {
    color: white;
}

.executive-summary-dark ul {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.executive-summary-dark strong {
    color: #93c5fd !important;
}
