/* Home Page Styles - Personalized Dashboard */

:root {
    --home-bg: #f8f9fa;
    --home-card-bg: #ffffff;
    --home-text: #202124;
    --home-text-secondary: #5f6368;
    --home-border: #dadce0;
    --home-accent: #1a73e8;
    --home-success: #34a853;
    --home-warning: #fbbc04;
    --home-danger: #ea4335;
    --home-shadow: rgba(0, 0, 0, 0.1);
    --home-hover-bg: #f1f3f4;
}

/* Dark Mode Variables */
/* Dark Mode Variables */
body.dark-mode,
html.dark-theme {
    --home-bg: #1f1f1f;
    --home-card-bg: #292929;
    --home-text: #e8eaed;
    --home-text-secondary: #9aa0a6;
    --home-border: #3c4043;
    --home-accent: #8ab4f8;
    --home-success: #81c995;
    --home-warning: #fdd663;
    --home-danger: #f28b82;
    --home-shadow: rgba(0, 0, 0, 0.3);
    --home-hover-bg: #353535;
}

.home-main {
    min-height: calc(100vh - 200px);
    padding: 32px 0;
    background: var(--home-bg);
}

/* Loading State */
.loading-container,
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--home-border);
    border-top-color: var(--home-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.error-container h2 {
    color: var(--home-text);
    margin-bottom: 8px;
}

.error-container p {
    color: var(--home-text-secondary);
    margin-bottom: 24px;
}

/* Welcome Section */
.welcome-section {
    margin-bottom: 32px;
}

.welcome-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
}

.welcome-text h1 {
    font-size: 32px;
    font-weight: 600;
    color: var(--home-text);
    margin: 0 0 8px 0;
}

.welcome-text p {
    font-size: 16px;
    color: var(--home-text-secondary);
    margin: 0;
}

.quick-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--home-card-bg);
    border: 1px solid var(--home-border);
    border-radius: 12px;
    padding: 20px;
    min-width: 140px;
    text-align: center;
    box-shadow: 0 1px 3px var(--home-shadow);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--home-shadow);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--home-accent);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--home-text-secondary);
    font-weight: 500;
}

/* Section Cards */
.section-card {
    background: var(--home-card-bg);
    border: 1px solid var(--home-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px var(--home-shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--home-border);
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--home-text);
    margin: 0;
}

.section-link {
    color: var(--home-accent);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s;
}

.section-link:hover {
    opacity: 0.8;
}

.today-date {
    color: var(--home-text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* Today's Classes */
.today-classes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.class-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    border-left: 4px solid;
    background: var(--home-hover-bg);
    transition: all 0.2s ease;
}

.class-card:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px var(--home-shadow);
}

.class-card.status-current {
    background: rgba(52, 168, 83, 0.1);
    border-left-color: var(--home-success);
}

.class-card.status-upcoming {
    border-left-color: var(--home-accent);
}

.class-card.status-past {
    opacity: 0.6;
    border-left-color: var(--home-text-secondary);
}

.class-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    font-weight: 600;
}

.class-time-start {
    font-size: 18px;
    color: var(--home-text);
}

.class-time-end {
    font-size: 12px;
    color: var(--home-text-secondary);
}

.class-info {
    flex: 1;
}

.class-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--home-text);
    margin-bottom: 4px;
}

.class-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--home-text-secondary);
}

.class-status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.class-status-badge.current {
    background: var(--home-success);
    color: white;
}

.class-status-badge.upcoming {
    background: var(--home-accent);
    color: white;
}

.no-classes-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--home-text-secondary);
}

.no-classes-message p {
    margin-bottom: 16px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

/* Upcoming Events */
.upcoming-events {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.event-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: var(--home-hover-bg);
    transition: background 0.2s;
}

.event-card:hover {
    background: var(--home-border);
}

.event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 60px;
    border-radius: 8px;
    background: var(--home-accent);
    color: white;
    font-weight: 600;
}

.event-date-day {
    font-size: 24px;
}

.event-date-month {
    font-size: 12px;
    text-transform: uppercase;
}

.event-info {
    flex: 1;
}

.event-type {
    font-size: 12px;
    color: var(--home-text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.event-description {
    font-size: 14px;
    color: var(--home-text);
    font-weight: 500;
}

/* GPA Overview */
.gpa-overview {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gpa-display {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #1a73e8 0%, #1765cc 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

/* Hover effects */
.gpa-display:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px var(--home-shadow);
    animation: shake 0.5s ease-in-out;
}

/* Light mode: darker background on hover */
body:not(.dark-mode) .gpa-display.excellent:hover {
    background: linear-gradient(135deg, #0d8547 0%, #0a6b39 100%) !important;
}

body:not(.dark-mode) .gpa-display.good:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%) !important;
}

body:not(.dark-mode) .gpa-display.average:hover {
    background: linear-gradient(135deg, #f57c00 0%, #d66d00 100%) !important;
}

body:not(.dark-mode) .gpa-display.below-average:hover {
    background: linear-gradient(135deg, #e64a19 0%, #c93d15 100%) !important;
}

body:not(.dark-mode) .gpa-display.poor:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%) !important;
}

/* Dark mode: lighter effect */
body.dark-mode .gpa-display:hover,
html.dark-theme .gpa-display:hover {
    filter: brightness(1.1);
}

/* Shake animation */
@keyframes shake {

    0%,
    100% {
        transform: translateY(-4px) scale(1.02) rotate(0deg);
    }

    25% {
        transform: translateY(-4px) scale(1.02) rotate(-1deg);
    }

    75% {
        transform: translateY(-4px) scale(1.02) rotate(1deg);
    }
}

/* GPA Card Color Scaling based on GPA value */
.gpa-display.excellent {
    background: linear-gradient(135deg, #0f9d58 0%, #0d8547 100%) !important;
}

.gpa-display.good {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%) !important;
}

.gpa-display.average {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%) !important;
}

.gpa-display.below-average {
    background: linear-gradient(135deg, #ff5722 0%, #e64a19 100%) !important;
}

.gpa-display.poor {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%) !important;
}

.gpa-value {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
}

.gpa-label {
    font-size: 14px;
    opacity: 0.9;
    color: white;
}

/* Recent Ratings Carousel */
.recent-ratings-carousel {
    position: relative;
    overflow: hidden;
    margin-top: 16px;
    border-radius: 12px;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

.rating-slide {
    min-width: 100%;
    padding: 16px;
    background: var(--home-hover-bg);
    border-radius: 8px;
    display: flex;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--home-border);
}

.rating-professor-info {
    flex: 1;
}

.rating-professor-info a {
    color: var(--home-text);
    font-weight: 600;
}

.rating-professor-info a:hover {
    color: var(--home-accent);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--home-border);
    cursor: pointer;
    transition: all 0.3s;
}

.carousel-dot:hover {
    background: var(--home-text-secondary);
}

.carousel-dot.active {
    background: var(--home-accent);
    width: 24px;
    border-radius: 4px;
}

.course-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.course-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    background: var(--home-hover-bg);
}

.course-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--home-text);
}

.course-item-grade {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    background: var(--home-accent);
    color: white;
}

/* Suggestions */
.suggestions-grid {
    display: grid;
    gap: 12px;
}

.suggestion-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    background: var(--home-hover-bg);
    border: 1px solid var(--home-border);
    transition: all 0.3s ease;
    text-decoration: none;
}

.suggestion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--home-shadow);
    border-color: var(--home-accent);
}

.suggestion-icon {
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--home-accent);
    color: white;
}

.suggestion-content {
    flex: 1;
}

.suggestion-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--home-text);
    margin-bottom: 4px;
}

.suggestion-description {
    font-size: 13px;
    color: var(--home-text-secondary);
    margin-bottom: 8px;
}

.suggestion-action {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--home-accent);
}

/* Week Overview */
.week-overview {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.week-day {
    padding: 16px;
    border-radius: 8px;
    background: var(--home-hover-bg);
}

.week-day-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--home-text);
    margin-bottom: 12px;
    text-transform: capitalize;
}

.week-day-classes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.week-class {
    display: flex;
    gap: 12px;
    padding: 8px;
    border-radius: 6px;
    background: var(--home-card-bg);
    border-left: 3px solid;
}

.week-class-time {
    font-size: 12px;
    font-weight: 600;
    color: var(--home-text-secondary);
    min-width: 60px;
}

.week-class-name {
    font-size: 13px;
    color: var(--home-text);
}

/* Responsive Design */
@media (max-width: 768px) {
    .welcome-header {
        flex-direction: column;
    }

    .quick-stats {
        width: 100%;
        justify-content: space-between;
    }

    .stat-card {
        flex: 1;
        min-width: 100px;
        padding: 16px 12px;
    }

    .stat-icon {
        font-size: 24px;
    }

    .stat-value {
        font-size: 20px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .section-card {
        padding: 16px;
    }

    .welcome-text h1 {
        font-size: 24px;
    }

    .class-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .home-main {
        padding: 16px 0;
    }

    .section-card {
        border-radius: 12px;
        padding: 12px;
    }

    .quick-stats {
        flex-direction: column;
        gap: 8px;
    }

    .stat-card {
        width: 100%;
    }
}

/* Utility Classes */
.btn-primary {
    display: inline-block;
    padding: 12px 24px;
    background: var(--home-accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--home-shadow);
}

.btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    background: var(--home-hover-bg);
    color: var(--home-text);
    border: 1px solid var(--home-border);
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--home-border);
}