/* ========================================
   School Management System — Custom CSS
   Theme: White + Dark Red (#B91C1C)
   ======================================== */

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #c4c4c4;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Smooth animations */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Toast animations */
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}
.toast-enter {
    animation: slideInRight 0.3s ease-out;
}
.toast-exit {
    animation: slideOutRight 0.3s ease-in forwards;
}

/* Page transition */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.page-enter {
    animation: fadeIn 0.3s ease-out;
}

/* Sidebar styles */
.sidebar {
    transition: width 0.3s ease, transform 0.3s ease;
}
.sidebar.collapsed {
    width: 72px;
}
.sidebar.collapsed .sidebar-label {
    display: none;
}
.sidebar.collapsed .sidebar-logo-text {
    display: none;
}

/* Mobile bottom nav */
.bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 8px);
}
.bottom-nav-item {
    transition: all 0.2s ease;
}
.bottom-nav-item.active {
    color: #B91C1C;
}
.bottom-nav-item.active .nav-icon {
    transform: scale(1.1);
}

/* Step wizard */
.step-indicator {
    transition: all 0.3s ease;
}
.step-indicator.active {
    background: #B91C1C;
    color: white;
    transform: scale(1.1);
}
.step-indicator.completed {
    background: #059669;
    color: white;
}
.step-line {
    transition: background 0.3s ease;
}
.step-line.active {
    background: #B91C1C;
}
.step-line.completed {
    background: #059669;
}

/* Form step panels */
.step-panel {
    display: none;
}
.step-panel.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #B91C1C;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Card hover effects */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(0,0,0,0.1);
}

/* Status badge pulse */
.status-active {
    position: relative;
}
.status-active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -2px;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #059669;
    box-shadow: 0 0 0 0 rgba(5,150,105,0.4);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(5,150,105,0.4); }
    70% { box-shadow: 0 0 0 10px rgba(5,150,105,0); }
    100% { box-shadow: 0 0 0 0 rgba(5,150,105,0); }
}

/* Mobile app-like cards */
.app-card {
    transition: transform 0.15s ease;
}
.app-card:active {
    transform: scale(0.96);
}

/* Modal */
.modal-overlay {
    transition: opacity 0.2s ease;
}
.modal-content {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Table responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Input focus ring */
input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.15);
}

/* Avatar */
.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
    text-transform: uppercase;
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl { width: 80px; height: 80px; font-size: 24px; }
