/* Custom styles for SmartExam */

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes bounceIn {
    0% { 
        transform: scale(0.3); 
        opacity: 0; 
    }
    50% { 
        transform: scale(1.05); 
    }
    70% { 
        transform: scale(0.9); 
    }
    100% { 
        transform: scale(1); 
        opacity: 1; 
    }
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: .5; 
    }
}

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

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

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

.animate-bounce-in {
    animation: bounceIn 0.6s ease-out;
}

.animate-pulse-slow {
    animation: pulse 3s linear infinite;
}

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

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

/* Loading Spinner */
.spinner {
    animation: spin 1s linear infinite;
}

/* Transitions */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.2s ease-in-out;
}

.hover-lift:hover {
    transform: translateY(-2px);
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background-color: rgb(59 130 246 / 0.1);
    color: rgb(59 130 246);
}

.badge-success {
    background-color: rgb(16 185 129 / 0.1);
    color: rgb(16 185 129);
}

.badge-warning {
    background-color: rgb(245 158 11 / 0.1);
    color: rgb(245 158 11);
}

.badge-danger {
    background-color: rgb(239 68 68 / 0.1);
    color: rgb(239 68 68);
}

/* Card Styles */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    overflow: hidden;
}

.dark .card {
    background: rgb(31 41 55);
}

.card-header {
    padding: 1.5rem 1.5rem 0 1.5rem;
    border-bottom: 1px solid rgb(229 231 235);
}

.dark .card-header {
    border-bottom-color: rgb(75 85 99);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 0 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid rgb(229 231 235);
}

.dark .card-footer {
    border-top-color: rgb(75 85 99);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    border: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(to right, rgb(59 130 246), rgb(147 51 234));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(to right, rgb(37 99 235), rgb(126 34 206));
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgb(107 114 128);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: rgb(75 85 99);
}

.btn-success {
    background: rgb(16 185 129);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: rgb(5 150 105);
}

.btn-danger {
    background: rgb(239 68 68);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: rgb(220 38 38);
}

.btn-outline {
    background: transparent;
    border: 2px solid currentColor;
}

.btn-outline:hover:not(:disabled) {
    background: currentColor;
    color: white;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: rgb(55 65 81);
}

.dark .form-label {
    color: rgb(209 213 219);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgb(209 213 219);
    border-radius: 0.5rem;
    background: white;
    color: rgb(17 24 39);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.dark .form-input {
    background: rgb(55 65 81);
    border-color: rgb(107 114 128);
    color: rgb(243 244 246);
}

.form-input:focus {
    outline: none;
    border-color: rgb(59 130 246);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.form-input:invalid {
    border-color: rgb(239 68 68);
}

.form-error {
    color: rgb(239 68 68);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgb(229 231 235);
}

.dark .table th,
.dark .table td {
    border-bottom-color: rgb(75 85 99);
}

.table th {
    background: rgb(249 250 251);
    font-weight: 600;
    color: rgb(55 65 81);
}

.dark .table th {
    background: rgb(55 65 81);
    color: rgb(209 213 219);
}

.table tbody tr:hover {
    background: rgb(249 250 251);
}

.dark .table tbody tr:hover {
    background: rgb(55 65 81);
}

/* Modal Styles */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 0.5);
    z-index: 50;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
    max-width: 32rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.dark .modal-content {
    background: rgb(31 41 55);
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid;
    margin-bottom: 1rem;
}

.alert-info {
    background: rgb(239 246 255);
    border-color: rgb(147 197 253);
    color: rgb(30 64 175);
}

.alert-success {
    background: rgb(236 253 245);
    border-color: rgb(110 231 183);
    color: rgb(6 95 70);
}

.alert-warning {
    background: rgb(255 251 235);
    border-color: rgb(252 211 77);
    color: rgb(146 64 14);
}

.alert-danger {
    background: rgb(254 242 242);
    border-color: rgb(252 165 165);
    color: rgb(153 27 27);
}

/* Dark mode alert styles */
.dark .alert-info {
    background: rgb(30 64 175 / 0.1);
    border-color: rgb(59 130 246);
    color: rgb(147 197 253);
}

.dark .alert-success {
    background: rgb(6 95 70 / 0.1);
    border-color: rgb(16 185 129);
    color: rgb(110 231 183);
}

.dark .alert-warning {
    background: rgb(146 64 14 / 0.1);
    border-color: rgb(245 158 11);
    color: rgb(252 211 77);
}

.dark .alert-danger {
    background: rgb(153 27 27 / 0.1);
    border-color: rgb(239 68 68);
    color: rgb(252 165 165);
}

/* Progress Bar */
.progress {
    background: rgb(229 231 235);
    border-radius: 9999px;
    height: 0.5rem;
    overflow: hidden;
}

.dark .progress {
    background: rgb(75 85 99);
}

.progress-bar {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.3s ease-in-out;
}

.progress-primary {
    background: rgb(59 130 246);
}

.progress-success {
    background: rgb(16 185 129);
}

.progress-warning {
    background: rgb(245 158 11);
}

.progress-danger {
    background: rgb(239 68 68);
}

/* Tooltip */
.tooltip {
    position: absolute;
    z-index: 1000;
    background: rgb(17 24 39);
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
    pointer-events: none;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgb(249 250 251);
}

.dark ::-webkit-scrollbar-track {
    background: rgb(31 41 55);
}

::-webkit-scrollbar-thumb {
    background: rgb(209 213 219);
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: rgb(107 114 128);
}

::-webkit-scrollbar-thumb:hover {
    background: rgb(156 163 175);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: rgb(75 85 99);
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}