/* Base styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
}

/* Hide utilities */
.hidden {
    display: none !important;
}

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

th, td {
    border: 1px solid #ddd;
    text-align: left;
    padding: 8px;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

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

/* Mobile responsive styles */
@media (max-width: 768px) {
    .table-responsive table {
        min-width: 600px;
    }
    
    /* Stack navbar items on mobile */
    .navbar-mobile {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* Mobile button styles */
    .btn-mobile {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Mobile form styles */
    .form-mobile {
        flex-direction: column;
    }
    
    .form-mobile .form-group {
        margin-bottom: 1rem;
    }
    
    /* Mobile card styles */
    .card-mobile {
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    /* Mobile grid adjustments */
    .grid-mobile {
        grid-template-columns: 1fr;
    }
    
    /* Mobile text sizes */
    .text-responsive {
        font-size: 0.875rem;
    }
    
    /* Mobile padding adjustments */
    .p-mobile {
        padding: 0.75rem;
    }
    
    /* Mobile margin adjustments */
    .m-mobile {
        margin: 0.5rem;
    }
}

/* Small device styles */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Smaller text on very small screens */
    .text-sm-mobile {
        font-size: 0.75rem;
    }
    
    /* Adjust button sizes */
    .btn-sm-mobile {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Stack form elements */
    .form-stack {
        flex-direction: column;
    }
    
    .form-stack > * {
        margin-bottom: 0.5rem;
    }
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-indicator.pending {
    background-color: #fbbf24;
}

.status-indicator.approved {
    background-color: #10b981;
}

.status-indicator.rejected {
    background-color: #ef4444;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

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

/* Focus styles for accessibility */
.focus-ring:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-after: always;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .border {
        border-width: 2px;
    }
    
    .text-gray-500 {
        color: #000 !important;
    }
    
    .text-gray-600 {
        color: #000 !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1f2937;
        --text-color: #f9fafb;
        --border-color: #4b5563;
    }
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

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

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

/* Hover effects */
.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
}

/* Custom form controls */
.form-control {
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Alert improvements */
.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
}

.alert-dismissible {
    padding-right: 3rem;
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.75rem 1.25rem;
    color: inherit;
    border: none;
    background: none;
    cursor: pointer;
}

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 140px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 150%;
    left: 50%;
    margin-left: -70px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* School card styles and animations */
.school-card {
    transition: all 0.3s ease-in-out;
    opacity: 1;
    transform: translateY(0);
}

.school-card.hidden {
    opacity: 0;
    transform: translateY(-10px);
    height: 0;
    margin: 0;
    padding: 0;
    border: none;
    overflow: hidden;
}

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

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

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Progress bar styles */
.progress-bar {
    width: 100%;
    height: 0.5rem;
    background-color: #e5e7eb;
    border-radius: 0.25rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #3b82f6;
    transition: width 0.3s ease-in-out;
    border-radius: 0.25rem;
}

/* Timeline styles */
.timeline-item {
    position: relative;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid #d1d5db;
    background-color: #f9fafb;
    border-radius: 0.5rem;
}

.timeline-item.completed {
    border-left-color: #10b981;
    background-color: #ecfdf5;
}

.timeline-item.rejected {
    border-left-color: #ef4444;
    background-color: #fef2f2;
}

.timeline-item:before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 1rem;
    width: 0.75rem;
    height: 0.75rem;
    background-color: #d1d5db;
    border-radius: 50%;
    border: 2px solid #ffffff;
}

.timeline-item.completed:before {
    background-color: #10b981;
}

.timeline-item.rejected:before {
    background-color: #ef4444;
}

/* Button animations */
.btn-animate {
    transition: all 0.2s ease-in-out;
}

.btn-animate:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-animate:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* School selection enhancements */
.school-search-highlight {
    background-color: #fef3c7;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

/* Responsive improvements for school cards */
@media (max-width: 768px) {
    .school-card {
        margin-bottom: 1rem;
    }
    
    .grid-cols-1.md\:grid-cols-2.xl\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .status-badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    .timeline-item {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
}

/* Loading states */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    background-color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* Smooth scrolling for form focus */
.smooth-scroll {
    scroll-behavior: smooth;
}

/* Enhanced form styles */
.form-enhanced {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.form-enhanced:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Notification styles */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background-color: #10b981;
    color: white;
}

.notification.error {
    background-color: #ef4444;
    color: white;
}

.notification.warning {
    background-color: #f59e0b;
    color: white;
}

.notification.info {
    background-color: #3b82f6;
    color: white;
}

/* Transfer request button styles */
.btn-request-disabled {
    background-color: #d1d5db !important;
    color: #6b7280 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    box-shadow: none !important;
}

.btn-request-disabled:hover {
    background-color: #d1d5db !important;
    color: #6b7280 !important;
    transform: none !important;
}

/* Pending request indicator */
.pending-request-indicator {
    background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
    border: 1px solid #f59e0b;
    animation: pulse-pending 2s infinite;
}

@keyframes pulse-pending {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* Enhanced card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

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

/* Disabled card state */
.card-disabled {
    opacity: 0.7;
    background-color: #f9fafb;
}

.card-disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Timeline Modal Styles */
.timeline-container {
    position: relative;
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
}

.timeline-line {
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e5e7eb;
    z-index: 1;
}

.timeline-dot {
    position: absolute;
    left: -6px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    z-index: 2;
}

/* Modal z-index fix */
.modal {
    z-index: 1000;
}

/* Mobile timeline adjustments */
@media (max-width: 768px) {
    .timeline-container {
        padding: 0.5rem;
    }
    
    .timeline-line {
        left: 0.5rem;
    }
}

/* Transfer request button enhancements */
.transfer-action-btn {
    position: relative;
    z-index: 10;
    cursor: pointer !important;
    pointer-events: auto !important;
    user-select: none;
    outline: none;
    border: none;
}

.transfer-action-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.transfer-action-btn:active {
    transform: scale(0.98);
}

/* Ensure form buttons are not disabled */
form button[type="submit"] {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Remove any potential overlay issues */
.transfer-actions-container {
    position: relative;
    z-index: 10;
}

/* Prevent double-click issues */
.transfer-action-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}