/* Custom Styles for Exam Creation Tool */

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

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Make footer stick to bottom */
footer {
    margin-top: auto;
}

/* Navigation Bar */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar-nav .nav-link {
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
}

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

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.card-header {
    background-color: var(--light-color);
    border-bottom: 2px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* Hover Shadow Effect */
.hover-shadow {
    transition: all 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.btn:active {
    transform: translateY(0);
}

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

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--light-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.125);
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

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

/* Badges */
.badge {
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    border-radius: 0.25rem;
}

/* Forms */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

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

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

/* Input Groups */
.input-group-text {
    background-color: var(--light-color);
    border: 1px solid #ced4da;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.125);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.alert-dismissible .btn-close {
    padding: 1.25rem 1rem;
}

/* Jumbotron (Bootstrap 5 replacement) */
.jumbotron {
    padding: 4rem 2rem;
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Question Cards */
.question-card {
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.question-card:hover {
    border-left-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

.question-card.selected {
    border-left-color: var(--success-color);
    background-color: rgba(25, 135, 84, 0.05);
}

/* Exam Cards */
.exam-card {
    height: 100%;
    transition: all 0.3s ease;
}

.exam-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.15);
}

.exam-card .card-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border-bottom: none;
}

.exam-card.draft .card-header {
    background: linear-gradient(135deg, var(--secondary-color), #5a6268);
}

.exam-card.published .card-header {
    background: linear-gradient(135deg, var(--success-color), #146c43);
}

.exam-card.archived .card-header {
    background: linear-gradient(135deg, var(--warning-color), #cc9a06);
}

/* Status Badges */
.status-badge {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Difficulty Badges */
.difficulty-easy {
    background-color: #d4edda;
    color: #155724;
}

.difficulty-medium {
    background-color: #fff3cd;
    color: #856404;
}

.difficulty-hard {
    background-color: #f8d7da;
    color: #721c24;
}

/* Role Badges */
.role-admin {
    background-color: #e7f3ff;
    color: #004085;
    border: 1px solid #004085;
}

.role-user {
    background-color: #e2f0e7;
    color: #155724;
    border: 1px solid #155724;
}

/* User Avatar Placeholder */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

/* Statistics Cards */
.card.border-primary, .card.border-success,
.card.border-warning, .card.border-info,
.card.border-danger {
    border-width: 2px !important;
}

/* Action Buttons Group */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-buttons .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Login Page */
.bg-light {
    background-color: #f8f9fa !important;
}

.login-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* Step Indicator (for multi-step forms) */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.step-indicator .step {
    flex: 1;
    text-align: center;
    padding: 1rem;
    border-bottom: 3px solid #e9ecef;
    color: #6c757d;
    transition: all 0.3s ease;
}

.step-indicator .step.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.step-indicator .step.completed {
    border-bottom-color: var(--success-color);
    color: var(--success-color);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

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

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

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

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.5s ease;
}

/* Tooltips */
.tooltip-inner {
    max-width: 300px;
    padding: 0.5rem 0.75rem;
    background-color: rgba(0, 0, 0, 0.9);
}

/* Dropdown Menu */
.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .jumbotron {
        padding: 2rem 1rem;
    }

    .jumbotron h1 {
        font-size: 2rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
    }

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

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .modal,
    footer,
    .action-buttons {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode */
    /*
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }

    .card {
        background-color: #2d2d2d;
        color: #e0e0e0;
    }

    .form-control, .form-select {
        background-color: #2d2d2d;
        color: #e0e0e0;
        border-color: #404040;
    }

    .table {
        color: #e0e0e0;
    }
    */
}

/* Utility Classes */
.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;
}

.cursor-pointer {
    cursor: pointer;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-75 {
    opacity: 0.75;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}
