/* AI Recruitment Platform Custom Styles */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* Base Styles */
:root {
    --primary-color: #7db72f;
    --primary-dark: #649226;
    --primary-light: #9dcd53;
    --secondary-color: #2f8fb7;
    --success-color: #7db72f;
    --info-color: #3498db;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --gray-100: #f5f6f7;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* Bootstrap Theme Overrides */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-primary:focus, .btn-primary:active {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 0.25rem rgba(125, 183, 47, 0.25);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-info {
    background-color: var(--info-color);
    border-color: var(--info-color);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--light-color);
}

/* RTL Support for Arabic */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .navbar-brand {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .me-1, [dir="rtl"] .me-2, [dir="rtl"] .me-3 {
    margin-left: 0.25rem !important;
    margin-right: 0 !important;
}

[dir="rtl"] .ms-1, [dir="rtl"] .ms-2, [dir="rtl"] .ms-3 {
    margin-right: 0.25rem !important;
    margin-left: 0 !important;
}

[dir="rtl"] .navbar-nav {
    flex-direction: row-reverse;
}

[dir="rtl"] .dropdown-menu {
    right: 0;
    left: auto;
}

[dir="rtl"] .progress-bar {
    right: 0;
    left: auto;
}

/* WhatsApp fields - Keep LTR even in RTL mode */
[dir="rtl"] #whatsapp_country_code,
[dir="rtl"] #whatsapp_phone_number {
    direction: ltr;
    text-align: left;
}

/* Keep the row direction for WhatsApp fields */
[dir="rtl"] .whatsapp-fields-row {
    direction: ltr;
}

/* Keep help text aligned properly */
[dir="rtl"] .whatsapp-fields-row small {
    text-align: left;
    display: block;
}

/* Landing Page Specific Styles */
.landing-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    position: relative;
    overflow: hidden;
    padding: 5rem 0;
    margin-top: -1rem;
    margin-bottom: 4rem;
    z-index: 1;
}

.landing-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, transparent 50%, rgba(255, 255, 255, 0.1) 50.5%, rgba(255, 255, 255, 0.1) 52%, transparent 52.5%),
        radial-gradient(circle at 80% 20%, transparent 50%, rgba(255, 255, 255, 0.1) 50.5%, rgba(255, 255, 255, 0.1) 52%, transparent 52.5%),
        radial-gradient(circle at 40% 40%, transparent 50%, rgba(255, 255, 255, 0.05) 50.5%, rgba(255, 255, 255, 0.05) 52%, transparent 52.5%);
    background-size: 100px 100px, 150px 150px, 200px 200px;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.landing-hero h1 {
    font-weight: 800;
    font-size: 3.5rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.landing-hero .lead {
    font-size: 1.25rem;
    font-weight: 400;
    opacity: 0.95;
    max-width: 600px;
}

.landing-hero .robot-icon {
    font-size: 12rem;
    opacity: 0.15;
    position: absolute;
    right: -2rem;
    top: 50%;
    transform: translateY(-50%) rotate(-15deg);
    animation: float-icon 6s ease-in-out infinite;
}

@keyframes float-icon {
    0%, 100% { transform: translateY(-50%) rotate(-15deg); }
    50% { transform: translateY(-45%) rotate(-10deg); }
}

/* Feature Cards */
.feature-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 2rem;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: white;
    box-shadow: var(--shadow-md);
}

.feature-card h5 {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--gray-600);
    line-height: 1.7;
    margin: 0;
}

/* Stats Section */
.stats-section {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    border-radius: 24px;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

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

.stats-section h2 {
    font-weight: 800;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
    position: relative;
    z-index: 1;
}

.stat-item .display-3 {
    font-weight: 900;
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, white, rgba(255, 255, 255, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-item p {
    font-weight: 600;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Custom Components */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 15px !important;
}

.card {
    border-radius: 12px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Job Description Styles */
.job-description {
    font-size: 0.95rem;
    line-height: 1.5;
}

.job-description p {
    margin-bottom: 0.75rem;
}

.job-description ul {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

.job-description li {
    margin-bottom: 0.5rem;
}

.job-description strong {
    color: var(--dark-color);
    font-weight: 600;
}

/* Compact Form Styles */
.form-label-sm {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.form-control-sm {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

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

.pulse {
    animation: pulse 1.5s infinite;
}

/* Language Section */
.language-section {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    border-radius: 24px;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
}

.language-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(125, 183, 47, 0.05) 0%, transparent 60%);
    animation: pulse-slow 10s ease-in-out infinite;
}

@keyframes pulse-slow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.language-item {
    text-align: center;
    transition: transform 0.3s ease;
}

.language-item:hover {
    transform: translateY(-5px);
}

.language-icon {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.language-icon:hover {
    box-shadow: var(--shadow-lg);
    transform: scale(1.05);
}

.flag-emoji {
    font-size: 3.5rem;
}

.language-name {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 1.1rem;
}

/* Navigation Enhancements */
.navbar {
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1030;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.nav-link {
    font-weight: 500;
    transition: color 0.2s ease-in-out;
    color: var(--gray-700) !important;
}

/* Dropdown Menu Z-index Fix */
.dropdown-menu {
    z-index: 1050;
}

.navbar-collapse {
    z-index: 1040;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* Button Enhancements */
.btn {
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-lg {
    padding: 16px 40px;
    font-size: 1.1rem;
    border-radius: 16px;
}

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

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

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: transparent;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* Form Enhancements */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid var(--gray-200);
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(125, 183, 47, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

/* Job Description Formatting */
.job-description {
    white-space: pre-line;
    line-height: 1.8;
}

.job-description h1, .job-description h2, .job-description h3 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.job-description ul, .job-description ol {
    padding-left: 1.5rem;
}

[dir="rtl"] .job-description ul, [dir="rtl"] .job-description ol {
    padding-right: 1.5rem;
    padding-left: 0;
}

/* Video Interview Styles */
.video-container {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

#preview {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

#recordingStatus {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

[dir="rtl"] #recordingStatus {
    left: 10px;
    right: auto;
}

.recording-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* Progress Bar Enhancements */
.progress {
    height: 8px;
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Badge Enhancements */
.badge {
    font-weight: 500;
    border-radius: 6px;
}

/* Table Enhancements */
.table {
    border-radius: 12px;
    overflow: hidden;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    background-color: #f8f9fa;
}

.table tbody tr:hover {
    background-color: rgba(125, 183, 47, 0.05);
}

/* Statistics Cards */
.stats-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: none;
    border-left: 4px solid var(--primary-color);
}

.stats-card.success {
    border-left-color: var(--success-color);
}

.stats-card.info {
    border-left-color: var(--info-color);
}

.stats-card.warning {
    border-left-color: var(--warning-color);
}

/* Alerts */
.alert {
    border-radius: 12px;
    border: none;
}

.alert-info {
    background: linear-gradient(135deg, #e1f5fe 0%, #f3f8fc 100%);
    color: var(--info-color);
}

.alert-success {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f2 100%);
    color: var(--success-color);
}

.alert-warning {
    background: linear-gradient(135deg, #fff8e1 0%, #fffcf3 100%);
    color: var(--warning-color);
}

.alert-danger {
    background: linear-gradient(135deg, #ffebee 0%, #fef5f5 100%);
    color: var(--danger-color);
}

/* Language Flags */
.language-flag {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    margin-right: 8px;
}

[dir="rtl"] .language-flag {
    margin-left: 8px;
    margin-right: 0;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
    }
    
    .hero-section .display-4 {
        font-size: 2.5rem;
    }
    
    .recording-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Fix mobile button touch targets */
    button, a.btn, input[type="submit"] {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        min-height: 44px;
        position: relative;
        z-index: 1;
    }
    
    /* Ensure dropdowns don't overlap buttons */
    .navbar-collapse {
        background: white;
        margin-top: 0.5rem;
        padding: 1rem;
        border-radius: 8px;
        box-shadow: var(--shadow-md);
    }
}

@media (max-width: 576px) {
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

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

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

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Sign-up vs Sign-in Button Distinction */
.btn-signup-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(125, 183, 47, 0.3);
}

.btn-signup-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #5a8629 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(125, 183, 47, 0.4);
    color: white;
}

.btn-signin-secondary {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
    font-weight: 500;
}

.btn-signin-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-800);
    transform: translateY(-1px);
}

/* Landing page button improvements */
.landing-hero .btn-signup-hero {
    background: white;
    color: var(--primary-color);
    font-size: 1.2rem;
    padding: 18px 45px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.landing-hero .btn-signup-hero:hover {
    background: white;
    color: var(--primary-dark);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.landing-hero .btn-signin-hero {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    padding: 16px 40px;
    font-weight: 500;
}

.landing-hero .btn-signin-hero:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
    color: white;
    transform: translateY(-2px);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(125, 183, 47, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(125, 183, 47, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(125, 183, 47, 0);
    }
}

.recording-pulse {
    animation: pulse 2s infinite;
}

/* Pulse button animation for AI interview */
@keyframes buttonPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(125, 183, 47, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(125, 183, 47, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(125, 183, 47, 0);
    }
}

.pulse-button {
    animation: buttonPulse 2s infinite;
}

/* Interview Step Indicators */
.step-indicator {
    padding: 1rem;
    border-radius: 12px;
    background: var(--light-color);
    color: var(--gray-600);
    transition: all 0.3s ease;
}

.step-indicator.active {
    background: linear-gradient(135deg, #f0f8e8 0%, #e0f2d0 100%);
    color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(125, 183, 47, 0.2);
}

.step-indicator.completed {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: var(--success-color);
}

.step-indicator i {
    transition: transform 0.3s ease;
}

.step-indicator.active i {
    transform: scale(1.1);
}

/* AI Status Bar */
#aiStatusBar {
    transition: all 0.3s ease;
}

/* Enhanced Video Container */
.video-container {
    position: relative;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.video-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark), var(--primary-color));
    border-radius: 16px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.video-container.recording::before {
    opacity: 1;
    animation: borderGlow 2s linear infinite;
}

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

/* Footer */
footer {
    margin-top: auto;
}

/* Accessibility Improvements */
.visually-hidden {
    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;
}

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

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn {
        border-width: 2px;
    }
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #ffffff;
        --card-bg: #2d2d2d;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .alert,
    footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}
