/**
 * QuizWiz Frontend Styles
 * Bootstrap-based responsive design with custom styling
 */

/* Root Variables */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;

    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --border-radius: 0.5rem;
}

/* Base Styles */
body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-brand i {
    font-size: 1.8rem;
    margin-right: 0.5rem;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.card-header {
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    border-bottom: none;
    font-weight: 600;
}

.card-body {
    padding: 2rem;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, var(--primary-color) 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #146c43 100%);
}

/* Form Elements */
.form-control, .form-select {
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

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

.form-label {
    margin-bottom: 0.75rem;
    color: #495057;
}

.form-label i {
    margin-right: 0.5rem;
}

/* File Upload */
.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Preview Section */
#questions-preview {
    max-height: 400px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.7) !important;
}

.preview-question {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.preview-question:last-child {
    margin-bottom: 0;
}

.preview-question h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.preview-question .badge {
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

.preview-question ul {
    margin-bottom: 0.5rem;
}

.preview-question ul li {
    padding: 0.25rem 0;
}

.preview-question ul li.correct {
    font-weight: 600;
    color: var(--success-color);
}

/* Result Section */
.result-link {
    display: block;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: inherit;
    border: 2px solid #e9ecef;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.result-link:hover {
    border-color: var(--primary-color);
    background: #f8f9fa;
    color: var(--primary-color);
    transform: translateX(10px);
}

.result-link i {
    font-size: 1.5rem;
    margin-right: 1rem;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(248, 249, 250, 0.95);
    z-index: 9999;
    backdrop-filter: blur(5px);
}

#loading-overlay .card {
    background: white;
    box-shadow: var(--shadow-md);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-danger {
    border-left-color: var(--danger-color);
    background: rgba(220, 53, 69, 0.1);
}

.alert-success {
    border-left-color: var(--success-color);
    background: rgba(25, 135, 84, 0.1);
}

.alert-info {
    border-left-color: var(--info-color);
    background: rgba(13, 202, 240, 0.1);
}

/* Modal */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.modal-header {
    background: var(--primary-color);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

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

/* Code blocks */
pre {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
}

pre code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Utilities */
.shadow {
    box-shadow: var(--shadow-md) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .card-body {
        padding: 1.5rem;
    }

    .display-4 {
        font-size: 2.5rem;
    }

    .btn {
        padding: 0.5rem 1rem;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .modal-dialog {
        margin: 1rem;
    }

    #questions-preview {
        max-height: 300px;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .navbar-brand i {
        font-size: 1.5rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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