/* Modern Executive Voice Generator Styles */

:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --secondary-gradient: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --info-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --accent-gradient: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    --neutral-gradient: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    --card-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --border-radius: 20px;
    --border-radius-sm: 12px;
    --border-radius-lg: 28px;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --backdrop-blur: blur(24px);
}

[data-bs-theme="dark"] {
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 400;
    line-height: 1.7;
    background: linear-gradient(135deg, #1f2937 0%, #374151 50%, #4b5563 100%);
    background-attachment: fixed;
    min-height: 100vh;
    letter-spacing: -0.01em;
}

[data-bs-theme="dark"] body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    background-attachment: fixed;
    color: #f8fafc;
}

.content-display {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.125rem;
    line-height: 1.8;
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--glass-border);
    padding: 0;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    white-space: normal;
    box-shadow: var(--card-shadow);
    color: #ffffff !important;
    font-weight: 400;
    letter-spacing: -0.01em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modern Card Styles */
.card {
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 0.6;
}

.card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--card-shadow-hover);
}

.card-header {
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    padding: 1.5rem;
    backdrop-filter: blur(20px);
}

.card-body {
    padding: 2.5rem;
    position: relative;
}

.card-footer {
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
    padding: 1.5rem;
}

.fact-highlight-verified {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.fact-highlight-flagged {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.executive-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.executive-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
}

/* Modern Upload Area */
.upload-area {
    border: 2px dashed var(--glass-border);
    border-radius: var(--border-radius);
    padding: 3rem;
    text-align: center;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.upload-area:hover {
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
}

.upload-area:hover::before {
    opacity: 0.1;
}

.upload-area.dragover {
    border-color: transparent;
    color: white;
    transform: scale(1.02);
}

.upload-area.dragover::before {
    opacity: 0.2;
}

/* Modern Button Styles */
.btn {
    border-radius: var(--border-radius-sm);
    padding: 0.875rem 2rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
    font-size: 0.95rem;
    text-transform: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4), 0 4px 6px -2px rgba(99, 102, 241, 0.1);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.6), 0 8px 10px -6px rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, #5b5bf6 0%, #7c3aed 50%, #9333ea 100%);
    color: white;
}

.btn-primary:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.5);
    background: var(--primary-gradient);
    color: white;
}

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

.btn-outline-primary {
    background: transparent;
    border: 2px solid #6366f1;
    color: #6366f1;
    position: relative;
    overflow: hidden;
}

.btn-outline-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    transition: left 0.3s ease;
    z-index: -1;
}

.btn-outline-primary:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
}

.document-list {
    max-height: 400px;
    overflow-y: auto;
    border-radius: var(--border-radius-sm);
}

.generate-form {
    background: var(--primary-gradient);
    color: white;
    padding: 3rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
}

.fact-check-summary {
    display: flex;
    justify-content: space-around;
    text-align: center;
    padding: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
}

.fact-check-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fact-check-count {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.loading-spinner {
    display: none;
}

.loading .loading-spinner {
    display: inline-block;
}

.profile-stats {
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    background-color: var(--bs-secondary);
    color: white;
}

.document-preview {
    max-height: 200px;
    overflow-y: auto;
    background-color: var(--bs-light);
    padding: 1rem;
    border-radius: 0.375rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

[data-bs-theme="dark"] .document-preview {
    background-color: var(--bs-dark);
}

.generation-progress {
    display: none;
}

.generation-progress.show {
    display: block;
}

.content-type-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.content-type-option {
    padding: 1rem;
    border: 2px solid var(--bs-border-color);
    border-radius: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.content-type-option:hover {
    border-color: var(--bs-primary);
    background-color: rgba(13, 110, 253, 0.1);
}

.content-type-option.selected {
    border-color: var(--bs-primary);
    background-color: var(--bs-primary);
    color: white;
}

/* Modern Form Styles */
.form-control, .form-select {
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    color: #ffffff !important;
}

/* Fix dropdown option visibility */
.form-select option {
    background-color: #1f2937 !important;
    color: #ffffff !important;
    padding: 0.75rem;
    border: none;
}

.form-select option:hover,
.form-select option:focus,
.form-select option:checked {
    background-color: #374151 !important;
    color: #ffffff !important;
}

/* Ensure select dropdown is visible */
select.form-select {
    background-color: rgba(31, 41, 55, 0.8) !important;
    color: #ffffff !important;
}

select.form-select:focus {
    background-color: rgba(31, 41, 55, 0.9) !important;
    color: #ffffff !important;
}

.form-control:focus, .form-select:focus {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    background: rgba(31, 41, 55, 0.9) !important;
    color: #ffffff !important;
    outline: none;
    transform: translateY(-1px);
}

.form-label {
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 0.875rem;
    font-size: 0.95rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    opacity: 0.9;
}

/* Badge Styles */
.badge {
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}

/* Alert Styles */
.alert {
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    color: white !important;
}

.alert-success {
    color: white !important;
    background: rgba(34, 197, 94, 0.2) !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
}

.alert-danger {
    color: white !important;
    background: rgba(239, 68, 68, 0.2) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.alert-warning {
    color: white !important;
    background: rgba(245, 158, 11, 0.2) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

.alert-info {
    color: white !important;
    background: rgba(59, 130, 246, 0.2) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

/* Dropdown Menu Styles */
.dropdown-menu {
    box-shadow: var(--card-shadow);
    border: 1px solid var(--glass-border) !important;
    background: var(--glass-bg) !important;
    backdrop-filter: var(--backdrop-blur) !important;
}

.dropdown-item {
    color: #ffffff !important;
    transition: all 0.2s ease-in-out;
    border-radius: var(--border-radius-sm);
    margin: 0.25rem 0.5rem;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    transform: translateX(4px);
}

/* Modal Styles */
.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
}

.modal-header {
    border-bottom: 1px solid var(--glass-border);
}

.modal-footer {
    border-top: 1px solid var(--glass-border);
}

/* List Group Styles */
.list-group-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm) !important;
    margin-bottom: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.list-group-item:hover {
    transform: translateX(4px);
    box-shadow: var(--card-shadow);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .content-display {
        padding: 1.5rem;
        font-size: 1rem;
    }
    
    .fact-check-summary {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .content-type-selector {
        grid-template-columns: 1fr;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
    }
}

/* Print styles */
@media print {
    .btn, .navbar, .card-header, .alert, .modal {
        display: none !important;
    }
    
    .content-display {
        background-color: white !important;
        color: black !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .fact-highlight-verified,
    .fact-highlight-flagged {
        background-color: transparent !important;
        border: 1px solid #ccc !important;
    }
}

/* Animation for loading states */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading-content {
    animation: pulse 1.5s infinite;
}

/* Accessibility improvements */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Typography enhancements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.display-1, .display-2, .display-3 {
    font-weight: 800;
    letter-spacing: -0.03em;
}

p, .card-text {
    line-height: 1.7;
    font-weight: 400;
}

.lead {
    font-weight: 400;
    line-height: 1.6;
}

/* Enhanced spacing */
.container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Smooth page transitions */
* {
    scroll-behavior: smooth;
}

/* Focus states for accessibility */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.5);
    outline-offset: 2px;
}

/* Enhanced button hover states */
.btn-outline-primary:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
    border-color: transparent;
}

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

/* Loading states */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Enhanced card interactions */
.executive-card:hover .card-body {
    backdrop-filter: var(--backdrop-blur) brightness(1.05);
}

/* Custom scrollbar for webkit browsers */
.document-list::-webkit-scrollbar,
.content-display::-webkit-scrollbar {
    width: 8px;
}

.document-list::-webkit-scrollbar-track,
.content-display::-webkit-scrollbar-track {
    background: var(--glass-bg);
    border-radius: 4px;
}

.document-list::-webkit-scrollbar-thumb,
.content-display::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 4px;
}

.document-list::-webkit-scrollbar-thumb:hover,
.content-display::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* Improved text readability */
.text-muted {
    color: #cbd5e1 !important;
    opacity: 0.85 !important;
}

/* Ensure text is visible on glass backgrounds */
.card-body,
.card-header,
.card-footer {
    color: #ffffff;
}

.card-title,
.card-subtitle,
.card-text {
    color: #ffffff !important;
}

/* Fix specific text elements */
.form-label {
    color: #ffffff !important;
}

.navbar-brand,
.nav-link {
    color: #ffffff !important;
}

.badge {
    color: #ffffff !important;
}

p, h1, h2, h3, h4, h5, h6, span, div {
    color: inherit;
}

/* Ensure readability in all contexts */
body, .container {
    color: #ffffff;
}

/* Fix specific text visibility issues */
.card-subtitle,
.text-muted,
small,
.small {
    color: #ffffff !important;
    opacity: 0.9;
}

/* Ensure all paragraph text is white */
p {
    color: #ffffff !important;
}

/* Executive info text */
.card-body p,
.card-body h6,
.card-body .text-muted {
    color: #ffffff !important;
}

/* Make sure all text in cards is visible */
.card * {
    color: #ffffff;
}

/* Better spacing for mobile */
@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
    
    h1, .display-2 {
        font-size: 1.75rem !important;
    }
    
    .lead {
        font-size: 1.1rem;
    }
    
    .content-display {
        padding: 1.5rem;
        font-size: 1rem;
    }
}
