/* Custom styles for AI Interview Platform */

/*
 * Updated colour palette inspired by the Indian national colours. These variables
 * will cascade throughout the application, tinting buttons, highlights and
 * charts with warm saffron tones and cool teals. Adjusting the Bootstrap
 * variables here ensures a consistent look and feel across every page.
 */
:root {
    /* Core brand colours */
    --primary-orange: #FF6B35;
    --primary-saffron: #FF8C42;
    --deep-orange: #E55604;
    --accent-teal: #20A39E;
    --accent-blue: #0B4F6C;
    --success-green: #16A085;
    --warning-amber: #F39C12;
    --light-bg: #F8F9FA;
    --dark-text: #2C3E50;
    
    /* Map Bootstrap variables to our palette */
    --primary: var(--primary-orange);
    --secondary: var(--accent-blue);
    --success: var(--success-green);
    --info: var(--accent-teal);
    --warning: var(--warning-amber);
    --danger: var(--deep-orange);
    --light: var(--light-bg);
    --dark: var(--dark-text);
}

/* Body and general styles */
/*
 * Use the modern Inter typeface across all pages for better legibility.
 * Provide fallbacks to system fonts in case Inter is not loaded. The
 * line-height remains unchanged for comfortable reading.
 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--light);
}

/* Custom button styles */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Override Bootstrap primary buttons with our palette */
.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}
.btn-primary:hover {
    background-color: var(--deep-orange) !important;
    border-color: var(--deep-orange) !important;
    color: #fff !important;
}

/* Accent coloured outlines for secondary actions */
.btn-outline-primary {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}
.btn-outline-primary:hover {
    background-color: var(--primary) !important;
    color: #fff !important;
}

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

/* Card enhancements */
.card {
    border-radius: 0.75rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Navigation enhancements */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    /* Apply a vibrant gradient to the brand name to echo the homepage hero */
    background: linear-gradient(135deg, var(--primary-saffron) 0%, var(--accent-teal) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin: 0 0.25rem;
    transition: all 0.3s ease;
}

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

/* Form enhancements */
.form-control, .form-select {
    border-radius: 0.5rem;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.input-group-text {
    border-radius: 0.5rem 0 0 0.5rem;
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-right: none;
}

/* Alert styles */
.alert {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Badge enhancements */
.badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Ensure badges align middle in flex containers */
.d-flex .badge,
.nav-link .badge,
.list-group-item .badge {
    align-self: center;
}

/* Progress bar */
.progress {
    height: 0.75rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Table enhancements */
.table {
    border-radius: 0.75rem;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Hero gradient for homepage and dashboard banners */
:root {
    --hero-gradient: linear-gradient(135deg, var(--primary-saffron) 0%, var(--accent-teal) 50%, var(--accent-blue) 100%);
}

/* AI-powered badge styling */
.ai-powered-badge {
    background: linear-gradient(45deg, #FF6B35, #FF8C42);
    color: white !important;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
}

/* Dashboard welcome section */
.dashboard-welcome-section {
    background: var(--hero-gradient);
    position: relative;
    overflow: hidden;
    color: #ffffff;
}

.dashboard-welcome-section::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 45%;
    background-image: url("/static/images/hero-pattern.png");
    background-size: cover;
    background-position: center;
    opacity: 0.6;
    pointer-events: none;
}

@media (max-width: 768px) {
    .dashboard-welcome-section::after {
        display: none;
    }
}

.dashboard-welcome-section .badge {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

/* Interview interface specific styles */
.question-card {
    animation: fadeInUp 0.5s ease;
}

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

/* Timer styles */
#timer {
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: bold;
}

/* Score visualization */
.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto;
}

.score-excellent {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.score-good {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: white;
}

.score-poor {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    color: white;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive utilities */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2.5rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    .display-6 {
        font-size: 1.75rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .position-fixed,
    footer,
    .no-print {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .container {
        max-width: 100% !important;
    }
    
    body {
        color: #000 !important;
        background: #fff !important;
    }
}

/* Dark theme overrides - Force text visibility */
.form-control,
.form-select {
    color: #ffffff !important;
    background-color: #2d3748 !important;
    border-color: #4a5568 !important;
}

.form-control:focus,
.form-select:focus {
    color: #ffffff !important;
    background-color: #2d3748 !important;
    border-color: #007bff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

.form-control::placeholder {
    color: #a0aec0 !important;
    opacity: 0.8 !important;
}

/* Additional specific overrides for dark theme */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #2d3748 !important;
    border-color: #4a5568 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #2d3748 !important;
    border-color: #007bff !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #a0aec0 !important;
}

[data-bs-theme="dark"] .input-group-text {
    background-color: #4a5568;
    border-color: #4a5568;
    color: #e2e8f0;
}

/* Accessibility improvements */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Animation for page transitions */
.container {
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Feature card hover effects */
.feature-card {
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Status indicators */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-active {
    background-color: var(--success);
}

.status-inactive {
    background-color: var(--secondary);
}

.status-pending {
    background-color: var(--warning);
}

/* Text utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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