/* Custom styles for the Writing Grader application */

/* Prevent white flash during page load - critical CSS */
html, body {
    background-color: #1a1a2e !important;
}

/* Ensure proper spacing and layout */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Custom card hover effects */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

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

/* Progress bar animations */
.progress-bar {
    transition: width 0.6s ease;
}

/* Score display styling */
.display-1 {
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Textarea styling */
textarea.form-control {
    resize: vertical;
    min-height: 200px;
}

/* Badge styling for criteria */
.badge {
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2.5rem;
    }
    
    .display-1 {
        font-size: 4rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Loading state for form submission */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    animation: spin 1s linear infinite;
}

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

/* Custom alert styling */
.alert {
    border: none;
    border-radius: 8px;
}

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

/* Drag handle styling */
.drag-handle,
.toggle-item .fa-grip-vertical {
    cursor: grab;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.drag-handle:hover,
.toggle-item:hover .fa-grip-vertical {
    opacity: 1;
    color: #0d6efd !important;
    transform: scale(1.2);
}

.drag-handle:active,
.toggle-item:active .fa-grip-vertical {
    cursor: grabbing;
}

/* Sortable ghost element styling */
.sortable-ghost {
    opacity: 0.4;
}

.criterion-item.sortable-ghost,
.toggle-item.sortable-ghost {
    background-color: rgba(13, 110, 253, 0.1);
    border-color: #0d6efd !important;
}
