/**
 * ScheduleMyClasses Page-Specific Styles
 * Styles that are specific to individual pages
 * Created: September 2025
 */

/* === DASHBOARD PAGES === */

/* Main Dashboard Layout */
.main-dashboard {
    padding: var(--space-6) 0;
    background: var(--gradient-neutral);
    min-height: 100vh;
}

/* Hero Section */
.main-hero {
    text-align: center;
    margin-bottom: var(--space-10);
    padding: var(--space-6) var(--space-4);
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    margin-left: var(--space-4);
    margin-right: var(--space-4);
    position: relative;
    overflow: hidden;
}

.main-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    50% { 
        transform: translateY(-15px) rotate(180deg); 
    }
}

.main-hero h1 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-2);
    position: relative;
    z-index: 2;
}

.main-hero p {
    font-size: var(--font-size-lg);
    margin: 0;
    opacity: 0.95;
    position: relative;
    z-index: 2;
}

/* Dashboard Grid */
.main-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

/* Main Dashboard Cards */
.main-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow-base);
    border: 2px solid transparent;
    transition: var(--transition-base);
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
}

.main-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: var(--transition-base);
}

.main-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(102, 126, 234, 0.2);
    text-decoration: none;
    color: inherit;
}

.main-card:hover::before {
    transform: scaleX(1);
}

.main-card-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-5);
    color: white;
    font-size: var(--font-size-2xl);
}

.main-card h3 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-3);
    color: var(--color-neutral-800);
}

.main-card p {
    color: var(--color-neutral-600);
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    margin: 0;
}

.main-card-arrow {
    position: absolute;
    bottom: var(--space-5);
    right: var(--space-5);
    color: var(--color-primary-500);
    font-size: var(--font-size-lg);
    transition: var(--transition-base);
}

.main-card:hover .main-card-arrow {
    transform: translateX(4px);
}

/* === PROFILE PAGES === */

.profile-main-content {
    min-height: calc(100vh - 200px);
}

.profile-form-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-base);
    padding: var(--space-8);
    margin-bottom: var(--space-8);
}

/* Profile Form Sections */
.profile-section {
    margin-bottom: var(--space-10);
}

.profile-section:last-child {
    margin-bottom: 0;
}

.profile-section-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-neutral-800);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--color-neutral-200);
}

/* === SCHEDULE PAGES === */

/* Schedule Creation/View Pages */
.schedule-main {
    padding: var(--space-6) 0;
    background: var(--color-neutral-50);
    min-height: 100vh;
}

/* Schedule Main Content - No padding to avoid large gaps */
.schedule-main-content {
    padding: 0 !important;
    min-height: calc(100vh - 200px);
}

.schedule-container {
    margin-top: 0 !important;
}

.schedule-header {
    background: white;
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.schedule-header h1 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-neutral-800);
    margin: 0;
}

.schedule-actions {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

/* Calendar Container */
.calendar-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-base);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

/* Schedule Controls */
.schedule-controls {
    background: white;
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-5);
}

/* Loading Spinner for Schedule Operations */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}

.spinner-container {
    text-align: center;
}

.spinner-overlay .loader {
    border: 0.6em solid #f3f3f3;
    border-top: 0.6em solid var(--color-primary-500);
    border-radius: 50%;
    width: 8vw;
    height: 8vw;
    max-width: 70px;
    max-height: 70px;
    min-width: 30px;
    min-height: 30px;
    animation: spin 1s linear infinite;
    margin: 1em auto;
}

.spinner-overlay .spinner-container p {
    margin-top: 1rem;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    color: var(--color-primary-500);
}

/* Schedule Setup Requirements Container */
.requirements-container {
    background: var(--color-neutral-50);
    border: 1px solid var(--color-neutral-300);
    border-radius: var(--radius-base);
    padding: var(--space-6);
    margin: var(--space-4);
}

/* Setup Status Indicators */
.setup-status {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    min-width: 18px;
    display: inline-block;
    flex-shrink: 0;
}

.required-status {
    color: var(--color-danger-500);
}

.optional-status {
    color: var(--color-neutral-500);
}

.required-status.complete {
    color: var(--color-success-500);
}

.optional-status.complete {
    color: var(--color-info-500);
}

/* Compact Setup List */
.compact-setup-list {
    font-size: var(--font-size-sm);
}

.compact-setup-list li {
    line-height: 1.4;
}

.compact-setup-list a {
    flex: 1;
}

/* Compact Tips and Info Boxes */
.compact-tips {
    background: var(--color-neutral-50);
    border: 1px solid var(--color-neutral-300);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
    font-size: var(--font-size-sm);
}

.schedule-controls .form-row {
    display: flex;
    gap: var(--space-4);
    align-items: end;
    flex-wrap: wrap;
}

.schedule-controls .form-group {
    flex: 1;
    min-width: 200px;
}

/* === STUDENT PAGES === */

.student-main {
    padding: var(--space-6) 0;
    background: var(--color-neutral-50);
    min-height: 100vh;
}

.student-list-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-base);
    overflow: hidden;
}

.student-list-header {
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-6);
    display: flex;
    justify-content: between;
    align-items: center;
}

.student-list-header h2 {
    margin: 0;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
}

.student-card {
    padding: var(--space-5);
    border-bottom: 1px solid var(--color-neutral-200);
    transition: var(--transition-fast);
}

/* Hover styles now handled by .card-hover-consistent class in base templates */

.student-card:last-child {
    border-bottom: none;
}

.student-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.student-name {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    color: var(--color-neutral-800);
}

.student-details {
    color: var(--color-neutral-600);
    font-size: var(--font-size-sm);
}

/* === PROFILE LOCATION SPECIFIC STYLES === */

/* === COMPACT FORM SYSTEM === */

/* Compact Card Variant */
.compact-card {
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-sm);
}

.compact-card .dashboard-card-header {
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
}

.compact-card .dashboard-form {
    padding: var(--space-4) !important;
}


/* Compact Form Elements - More Aggressive */
.compact-form .form-group,
.compact-form .mb-3 {
    margin-bottom: var(--space-2) !important;
}

.compact-form .form-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-1) !important;
    color: var(--color-neutral-700);
}

.compact-form .form-control,
.compact-form .form-select {
    padding: var(--space-1) var(--space-2) !important;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-sm);
    min-height: 32px !important;
}

.compact-form .btn {
    padding: var(--space-1) var(--space-3) !important;
    font-size: var(--font-size-sm);
}

.compact-form .table th,
.compact-form .table td {
    padding: var(--space-1) var(--space-2) !important;
    font-size: var(--font-size-sm);
}

/* Compact Button Group */
.compact-form .button-group {
    margin-top: var(--space-2);
    gap: var(--space-2);
}

/* Compact Info Boxes */
.compact-form .alert,
.compact-form .location-info {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
    margin-bottom: var(--space-3);
}

/* Location Management - Compact */
.location-table {
    margin-top: var(--space-2);
}

.location-table .table th,
.location-table .table td {
    padding: var(--space-1) var(--space-2) !important;
    vertical-align: middle;
    font-size: var(--font-size-sm);
}

.location-table .table thead th {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    background-color: var(--color-neutral-50);
}

.location-table .form-control,
.location-table input[type="text"] {
    border: var(--form-input-border);
    border-radius: var(--form-input-radius);
    padding: var(--form-input-padding);
    width: 100%;
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
}

.location-table input[type="text"]:focus {
    border-color: var(--color-primary-400);
    outline: 0;
    box-shadow: var(--form-input-focus);
}

.location-table .form-check-input {
    margin-top: 0;
}

/* Hide Django DELETE checkbox */
input[name$="-DELETE"] {
    display: none;
}

.delete-location {
    font-size: var(--font-size-xs);
    padding: var(--space-1) var(--space-2);
}

.location-info {
    background: var(--color-neutral-50);
    border: 1px solid var(--color-neutral-300);
    border-radius: var(--radius-base);
    padding: var(--space-2);
    margin-bottom: var(--space-3);
}

.location-info p {
    margin-bottom: 0;
    font-size: var(--font-size-xs);
    line-height: var(--line-height-tight);
}

.button-group {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--space-4);
}

.travel-time-section {
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-neutral-300);
}

.travel-time-section h6 {
    margin-bottom: var(--space-2);
}

.travel-time-section p {
    margin-bottom: var(--space-3);
}

.action-column {
    width: 80px;
}

/* === PROFILE AVAILABILITY SPECIFIC STYLES === */

/* Day of week dropdown - now uses reusable .form-select-4 class from components.css */
/* Note: Templates should use class="form-select form-select-4" for 4-option dropdowns */

/* Schedule preference info box */
.schedule-info {
    background: var(--color-neutral-50);
    border: 1px solid var(--color-neutral-300);
    border-radius: var(--radius-base);
    padding: var(--space-3);
    margin-top: var(--space-2);
}

.schedule-info ul {
    margin-bottom: 0;
    padding-left: var(--space-5);
}

.schedule-info li {
    margin-bottom: var(--space-1);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
}

/* Travel Time Matrix Scrolling */
.travel-matrix-table {
    overflow-x: auto;
    max-width: 100%;
    margin: 0;
    border: 1px solid var(--color-neutral-300);
    border-radius: var(--radius-base);
}

.travel-matrix-table .table {
    margin-bottom: 0;
    min-width: 500px; /* Ensure minimum width for proper display */
}

.travel-matrix-table .table th,
.travel-matrix-table .table td {
    padding: var(--space-2);
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.travel-matrix-table .table th {
    background-color: var(--color-neutral-50);
    font-weight: var(--font-weight-semibold);
    border-bottom: 2px solid var(--color-neutral-300);
    position: sticky;
    top: 0;
    z-index: 10;
}

.travel-matrix-table .table td {
    border: 1px solid var(--color-neutral-300);
}

/* === RESPONSIVE DESIGN === */

@media (max-width: 768px) {
    .main-hero {
        margin-left: var(--space-2);
        margin-right: var(--space-2);
        padding: var(--space-5) var(--space-3);
    }
    
    .main-hero h1 {
        font-size: var(--font-size-3xl);
    }
    
    .main-grid {
        grid-template-columns: 1fr;
        padding: 0 var(--space-2);
    }
    
    .main-card {
        padding: var(--space-6);
    }
    
    .main-card:hover {
        transform: translateY(-4px);
    }
    
    .schedule-controls .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .schedule-controls .form-group {
        min-width: auto;
    }
    
    .schedule-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .student-info {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .main-dashboard,
    .schedule-main,
    .student-main {
        padding: var(--space-4) 0;
    }
    
    .profile-form-container,
    .calendar-container {
        margin: 0 var(--space-2);
        padding: var(--space-5);
    }
    
    .main-hero h1 {
        font-size: var(--font-size-2xl);
    }
    
    .main-card-icon {
        width: 50px;
        height: 50px;
        font-size: var(--font-size-xl);
    }
}

/* === SHARED UI PATTERNS === */

/* Schedule preference info boxes - universal class */
.preference-info-box,
.schedule-info {
    background: var(--color-info-100); /* Semantic info background - maintains design system consistency */
    border: 1px solid var(--color-info-200, var(--color-neutral-300));
    border-radius: var(--radius-base);
    padding: var(--space-3);
    margin-top: var(--space-3);
    color: var(--color-info-700);
}

.preference-info-box ul,
.schedule-info ul {
    margin-bottom: 0;
    padding-left: var(--space-5);
}

.preference-info-box li,
.schedule-info li {
    margin-bottom: var(--space-1);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
}

.preference-info-box li:last-child,
.schedule-info li:last-child {
    margin-bottom: 0;
}

/* Enhanced form label visibility - reusable class */
.form-label-enhanced {
    font-weight: var(--font-weight-semibold) !important;
    color: var(--color-neutral-800) !important;
    opacity: 1 !important;
}