/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --surface-lighter: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --cancelled: #94a3b8;
    --border-radius: 16px;
    --border-radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: backgroundPulse 15s ease-in-out infinite;
}

@keyframes backgroundPulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 35px;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.clock-container {
    text-align: right;
}

.time {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {

    0%,
    100% {
        text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    }

    50% {
        text-shadow: 0 0 20px rgba(99, 102, 241, 0.8), 0 0 30px rgba(139, 92, 246, 0.6);
    }
}

.date {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Card Component */
.card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    margin-bottom: 30px;
    /* Add spacing between sections */
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    animation: fadeInUp 0.5s ease-out backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(99, 102, 241, 0.3);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-bottom: 10px;
    border-bottom: 2px solid;
    border-image: linear-gradient(90deg, var(--primary-color), var(--secondary-color)) 1;
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

/* Search Section */
.search-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-primary);
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 0 20px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 22px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    color: white;
    position: relative;
    overflow: hidden;
}

.search-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.search-btn:hover::before {
    width: 300px;
    height: 300px;
}

.search-btn svg {
    position: relative;
    z-index: 1;
}

.google-btn {
    background: linear-gradient(135deg, #4285f4, #34a853);
}

.chatgpt-btn {
    background: linear-gradient(135deg, #10a37f, #1a7f64);
}

.github-btn {
    background: linear-gradient(135deg, #333, #24292e);
}

.brave-btn {
    background: linear-gradient(135deg, #fb542b, #ff6a3d);
}

.search-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.search-btn:active {
    transform: translateY(-1px) scale(0.98);
}

/* OneNote / Current Notebook Section */
.current-notebook {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-lesson,
.no-notebook,
.has-notebook {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    text-align: center;
}

.no-lesson svg,
.no-notebook svg {
    color: var(--text-secondary);
    opacity: 0.5;
    animation: pulse 2s ease-in-out infinite;
}

.no-lesson p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-style: italic;
}

.current-subject-small {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.current-subject {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-light);
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.no-notebook-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
    margin: 0;
}

.notebook-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    font-size: 1.05rem;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-top: 8px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.notebook-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.notebook-btn:hover::before {
    left: 100%;
}

.notebook-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.notebook-btn:active {
    transform: translateY(0) scale(1.02);
}


/* Timetable Section */
.sync-mode-toggle {
    margin-bottom: 20px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    width: 56px;
    height: 28px;
    background: rgba(99, 102, 241, 0.3);
    border-radius: 14px;
    transition: var(--transition);
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input:checked+.toggle-slider {
    background: var(--success);
}

.toggle-label input:checked+.toggle-slider::before {
    transform: translateX(28px);
}

.toggle-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-label input:checked~.toggle-text .manual-text {
    display: none;
}

.toggle-label input:not(:checked)~.toggle-text .auto-text {
    display: none;
}

.upload-section {
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(99, 102, 241, 0.1);
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    text-align: center;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5);
}

.upload-btn:active {
    transform: translateY(0);
}

.upload-hint {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}


.lesson-info,
.exam-item {
    padding: 18px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    margin-bottom: 12px;
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.lesson-info:hover,
.exam-item:hover {
    transform: translateX(5px);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: var(--shadow-md);
}

.exam-item {
    border-left-color: var(--warning);
}

.lesson-info.cancelled {
    border-left-color: var(--cancelled);
    opacity: 0.7;
}

.lesson-title,
.exam-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.lesson-location,
.exam-location {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.15);
    padding: 4px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.lesson-time,
.exam-time {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.lesson-countdown {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-light);
    margin-top: 8px;
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    text-align: center;
    animation: glowBox 2s ease-in-out infinite;
}

@keyframes glowBox {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.3);
    }

    50% {
        box-shadow: 0 0 15px rgba(99, 102, 241, 0.6);
    }
}

.lesson-description,
.exam-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.special-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 8px;
}

.special-badge.cancelled {
    background: rgba(148, 163, 184, 0.2);
    color: var(--cancelled);
}

.special-badge.moved {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.special-badge.room-change {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}

.error-message {
    color: var(--error);
    padding: 15px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    border-left: 4px solid var(--error);
}

.no-data {
    color: var(--text-secondary);
    padding: 15px;
    text-align: center;
    font-style: italic;
}

/* Weather Section */
.weather-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.weather-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.weather-main:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.weather-icon {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.weather-temp {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.weather-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.weather-detail-item {
    padding: 18px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.weather-detail-item:hover {
    transform: translateY(-3px);
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
}

.weather-detail-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.weather-detail-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Today's Lessons */
.todays-lessons {
    margin-top: 30px;
    margin-bottom: 30px;
}

.todays-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.today-lesson-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border-left: 3px solid var(--primary-color);
    transition: var(--transition);
}

.today-lesson-item:hover {
    transform: translateX(5px);
    background: rgba(99, 102, 241, 0.1);
    border-left-color: var(--accent-color);
}

.today-time {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-light);
    min-width: 90px;
    font-family: 'Courier New', monospace;
}

.today-subject {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.lesson-location-inline {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 6px;
}

.exam-badge-inline {
    font-size: 0.8rem;
    color: var(--warning);
    padding: 4px 10px;
    background: rgba(245, 158, 11, 0.2);
    border-radius: 6px;
    font-weight: 600;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .clock-container {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .time {
        font-size: 2rem;
    }

    .search-buttons {
        grid-template-columns: 1fr;
    }

    .weather-details {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Stagger animation for cards */
.left-column .card:nth-child(1) {
    animation-delay: 0.1s;
}

.left-column .card:nth-child(2) {
    animation-delay: 0.2s;
}

.right-column .card:nth-child(1) {
    animation-delay: 0.15s;
}

.right-column .card:nth-child(2) {
    animation-delay: 0.25s;
}

/* Loading state */
.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Success message */
.success-message {
    color: var(--success);
    padding: 15px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 12px;
    border-left: 4px solid var(--success);
    margin-bottom: 15px;
    animation: slideIn 0.3s ease-out;
}

.error-message {
    color: var(--error);
    padding: 15px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 12px;
    border-left: 4px solid var(--error);
    animation: slideIn 0.3s ease-out;
}

.no-data {
    color: var(--text-secondary);
    padding: 15px;
    text-align: center;
    font-style: italic;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Header Search Styles */
.header-search {
    flex: 1;
    max-width: 600px;
    margin: 0 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.search-input-header {
    width: 100%;
    padding: 12px 20px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.search-input-header:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-input-header::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.search-buttons-header {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.search-btn-header {
    padding: 8px 12px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

.search-btn-header:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.search-btn-header:active {
    transform: translateY(0);
}

.search-btn-header.google-btn {
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: white;
}

.search-btn-header.chatgpt-btn {
    background: linear-gradient(135deg, #10a37f, #1a7f64);
    color: white;
}

.search-btn-header.github-btn {
    background: linear-gradient(135deg, #333, #24292e);
    color: white;
}

.search-btn-header.brave-btn {
    background: linear-gradient(135deg, #fb542b, #ff6a3d);
    color: white;
}

/* Responsive adjustments for header search */
@media (max-width: 1024px) {
    .header {
        flex-direction: column;
        gap: 20px;
    }

    .header-search {
        max-width: 100%;
        margin: 0;
        order: 2;
    }

    .clock-container {
        text-align: center;
    }

    .logo {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .search-buttons-header {
        width: 100%;
    }

    .search-btn-header {
        flex: 1;
        min-width: 70px;
    }

    .search-btn-header svg {
        width: 18px;
        height: 18px;
    }
}

/* ====== COMPACT MODE STYLES ====== */
.container.compact {
    max-width: 100vw;
    padding: 10px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.compact-header {
    padding: 12px 20px !important;
    margin-bottom: 10px !important;
    min-height: auto !important;
}

.compact-header .logo h1 {
    font-size: 1.8rem !important;
}

.compact-clock .time {
    font-size: 1.8rem !important;
}

.compact-clock .date {
    font-size: 0.85rem !important;
}

.controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.lang-btn,
.notify-btn,
.logout-btn {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lang-btn:hover,
.notify-btn:hover,
.logout-btn:hover {
    background: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.notify-btn.active {
    background: rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.5);
}

.compact-main {
    flex: 1;
    overflow: hidden;
    margin: 0 !important;
}

.compact-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    height: 100%;
}

.compact-card {
    padding: 12px !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.compact-card h2 {
    font-size: 1.1rem !important;
    margin-bottom: 10px !important;
    padding-bottom: 6px !important;
}

.compact-card h3 {
    font-size: 0.95rem !important;
    margin-bottom: 8px !important;
}

.current-notebook.compact,
.lesson-info.compact {
    font-size: 0.85rem !important;
    padding: 8px !important;
}

.todays-list.compact,
.exams-list.compact {
    flex: 1;
    overflow-y: auto;
    font-size: 0.85rem !important;
}

.today-lesson-item {
    padding: 6px 10px !important;
    margin-bottom: 4px !important;
}

.today-time {
    font-size: 0.8rem !important;
}

.today-subject {
    font-size: 0.85rem !important;
}

.exam-item {
    padding: 8px !important;
    margin-bottom: 6px !important;
}

.exam-title {
    font-size: 0.9rem !important;
}

.exam-time,
.lesson-time {
    font-size: 0.8rem !important;
}

.lesson-countdown {
    font-size: 0.9rem !important;
    padding: 6px 10px !important;
    margin-top: 6px !important;
}

/* Hide footer in compact mode */
.container.compact .footer {
    display: none;
}

/* Scrollbar for compact mode */
.todays-list.compact::-webkit-scrollbar,
.exams-list.compact::-webkit-scrollbar {
    width: 4px;
}

.todays-list.compact::-webkit-scrollbar-thumb,
.exams-list.compact::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

/* ====== LOGIN PAGE STYLES ====== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

.login-box {
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    width: 400px;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.6s ease-out;
}

.login-title {
    text-align: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 30px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-input {
    padding: 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.login-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.login-button {
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.login-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
}

.login-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 15px;
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(99, 102, 241, 0.5);
    border-left: 4px solid var(--warning);
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
    max-width: 300px;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification-toast .toast-title {
    font-weight: 600;
    color: var(--warning);
    margin-bottom: 5px;
}

.notification-toast .toast-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Responsive for compact mode */
@media (max-width: 1200px) {
    .compact-row {
        grid-template-columns: 1fr;
        gap: 8px;
        overflow-y: auto;
    }

    .compact-card {
        height: auto;
        min-height: 150px;
    }
}

/* ====== SUPER COMPACT MODE OVERRIDES ====== */
.container.compact {
    padding: 8px !important;
    height: 100vh !important;
    overflow: hidden !important;
}

.compact-header {
    padding: 8px 15px !important;
    margin-bottom: 8px !important;
}

.compact-header .logo h1 {
    font-size: 1.5rem !important;
}

.compact-clock .time {
    font-size: 1.5rem !important;
}

.compact-clock .date {
    font-size: 0.75rem !important;
}

.compact-main {
    flex: 1 !important;
    overflow: hidden !important;
}

.compact-row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    height: 100% !important;
}

.compact-card {
    padding: 10px !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.compact-card h2 {
    font-size: 0.95rem !important;
    margin-bottom: 8px !important;
    padding-bottom: 4px !important;
}

/* Make current lesson super compact - same styling as next lesson */
.current-notebook.compact {
    padding: 6px !important;
    font-size: 0.75rem !important;
    display: block !important;
}

.current-notebook.compact .lesson-card {
    width: 100% !important;
}

.current-notebook.compact .lesson-title {
    font-size: 0.85rem !important;
    margin-bottom: 4px !important;
}

.current-notebook.compact .lesson-location {
    padding: 2px 6px !important;
    font-size: 0.7rem !important;
    margin-bottom: 4px !important;
}

.current-notebook.compact .lesson-countdown {
    font-size: 0.75rem !important;
    padding: 4px 8px !important;
    margin-top: 4px !important;
}

.current-notebook.compact .notebook-btn {
    padding: 6px 12px !important;
    font-size: 0.75rem !important;
    margin-top: 4px !important;
}

.current-notebook.compact svg {
    width: 10px !important;
    height: 10px !important;
}

.current-notebook.compact .notebook-btn svg {
    width: 16px !important;
    height: 16px !important;
}

/* Make next lesson super compact */
.lesson-info.compact {
    padding: 6px !important;
    font-size: 0.75rem !important;
}

.lesson-info.compact .lesson-title {
    font-size: 0.85rem !important;
    margin-bottom: 4px !important;
}

.lesson-info.compact .lesson-location {
    padding: 2px 6px !important;
    font-size: 0.7rem !important;
    margin-bottom: 4px !important;
}

.lesson-info.compact .lesson-time {
    font-size: 0.7rem !important;
    margin-bottom: 4px !important;
}

.lesson-info.compact .lesson-countdown {
    font-size: 0.75rem !important;
    padding: 4px 8px !important;
    margin-top: 4px !important;
}

.lesson-info.compact svg {
    width: 10px !important;
    height: 10px !important;
}

/* Make today's lessons ultra compact */
.todays-list.compact {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 2px !important;
}

.todays-list.compact .today-lesson-item {
    padding: 4px 8px !important;
    margin-bottom: 3px !important;
    border-radius: 6px !important;
}

.todays-list.compact .today-time {
    font-size: 0.7rem !important;
    min-width: 70px !important;
}

.todays-list.compact .today-subject {
    font-size: 0.75rem !important;
}

.todays-list.compact .lesson-location-inline {
    font-size: 0.65rem !important;
    padding: 2px 6px !important;
}

.todays-list.compact .exam-badge-inline {
    font-size: 0.65rem !important;
    padding: 2px 6px !important;
}

/* Make exams ultra compact */
.exams-list.compact {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 2px !important;
}

.exams-list.compact .exam-item {
    padding: 6px 8px !important;
    margin-bottom: 4px !important;
    border-radius: 6px !important;
}

.exams-list.compact .exam-title {
    font-size: 0.8rem !important;
    margin-bottom: 3px !important;
}

.exams-list.compact .exam-location {
    padding: 2px 6px !important;
    font-size: 0.65rem !important;
    margin-bottom: 3px !important;
}

.exams-list.compact .exam-time {
    font-size: 0.7rem !important;
    margin-bottom: 2px !important;
}

.exams-list.compact svg {
    width: 10px !important;
    height: 10px !important;
}

/* Compact scrollbars */
.todays-list.compact::-webkit-scrollbar,
.exams-list.compact::-webkit-scrollbar {
    width: 3px !important;
}

/* Remove margins from paragraphs in compact mode */
.compact p {
    margin: 0 !important;
}

/* Adjust loading text */
.compact .loading {
    padding: 10px !important;
    font-size: 0.75rem !important;
}

/* No data messages - compact */
.compact .no-data {
    padding: 8px !important;
    font-size: 0.75rem !important;
}

/* Make special badges smaller */
.compact .special-badge {
    padding: 2px 6px !important;
    font-size: 0.65rem !important;
    margin-top: 4px !important;
}

/* ====== FULL-WIDTH 4-COLUMN LAYOUT ====== */
.compact-row {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
    height: 100% !important;
    width: 100% !important;
}

/* ====== COMPACT SEARCH BAR ====== */
.compact-search {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    max-width: 400px;
}

.search-input-compact {
    padding: 6px 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.8rem;
    outline: none;
    transition: var(--transition);
    flex: 1;
}

.search-input-compact:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--primary-color);
}

.search-input-compact::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.search-buttons-compact {
    display: flex;
    gap: 4px;
}

.search-btn-compact {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    color: white;
}

.search-btn-compact:hover {
    transform: translateY(-1px);
}

.search-btn-compact.google-btn {
    background: #4285f4;
}

.search-btn-compact.chatgpt-btn {
    background: #10a37f;
}

.search-btn-compact.github-btn {
    background: #24292e;
}

.search-btn-compact.brave-btn {
    background: #fb542b;
}

/* ====== COMPACT WEATHER STYLES ====== */
.weather-content.compact {
    flex: 1;
    overflow-y: auto;
    font-size: 0.75rem !important;
}

.weather-content.compact .weather-main {
    padding: 8px !important;
    font-size: 0.75rem !important;
}

.weather-content.compact .weather-temp {
    font-size: 1.5rem !important;
}

.weather-content.compact .weather-description {
    font-size: 0.75rem !important;
}

.weather-content.compact .weather-icon {
    width: 40px !important;
    height: 40px !important;
}

.weather-content.compact .weather-details {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.weather-content.compact .weather-detail-item {
    padding: 6px !important;
    font-size: 0.7rem !important;
    display: flex !important;
    justify-content: space-between !important;
}

.weather-content.compact .weather-detail-label {
    font-size: 0.7rem !important;
}

.weather-content.compact .weather-detail-value {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
}

/* Ensure container fills screen width */
.container.compact {
    max-width: 100vw !important;
    padding: 8px !important;
}

.compact-header {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .compact-row {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-template-rows: repeat(2, 1fr) !important;
    }
}

@media (max-width: 900px) {
    .compact-row {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        overflow-y: auto;
    }

    .compact-card {
        height: auto !important;
        min-height: 200px !important;
    }
}

/* ====== SPACING FIX FOR HEADER ====== */
.compact-main {
    margin-top: 6px !important;
}

/* Prevent card hover from overlapping header */
.compact-card:hover {
    transform: translateY(0) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
}

/* ====== FIX: ALWAYS 4 COLUMNS IN ONE ROW ====== */
.compact-row {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-template-rows: 1fr !important;
    gap: 8px !important;
    height: 100% !important;
    width: 100% !important;
}

/* Remove the 2x2 grid at 1400px - keep 4 columns */
@media (max-width: 1400px) {
    .compact-row {
        grid-template-columns: repeat(4, 1fr) !important;
        grid-template-rows: 1fr !important;
    }
}

/* Only on very small screens go to single column */
@media (max-width: 800px) {
    .compact-row {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        overflow-y: auto;
    }

    .compact-card {
        height: auto !important;
        min-height: 200px !important;
    }
}

/* ====== ICON-BASED SEARCH BUTTONS ====== */
.search-btn-compact {
    padding: 6px 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.search-btn-compact svg {
    display: block !important;
}

/* ====== FORCE FULL SCREEN WIDTH ====== */
.container.compact {
    max-width: 100vw !important;
    width: 100vw !important;
    margin: 0 !important;
    padding: 8px !important;
    box-sizing: border-box !important;
}

.compact-header {
    width: 100% !important;
    box-sizing: border-box !important;
}

.compact-main {
    width: 100% !important;
    box-sizing: border-box !important;
}

.compact-row {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ====== ENSURE BODY IS FULL WIDTH ====== */
body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    overflow-x: hidden !important;
}

/* ====== MAKE EACH COLUMN FILL 1/4 OF SCREEN ====== */
.compact-card {
    height: 100% !important;
    min-height: 0 !important;
}

.compact-row {
    height: calc(100vh - 60px) !important;
    /* Full height minus header */
}

.compact-main {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
}

/* ====== UNIFIED LESSON CARD STYLE ====== */
.lesson-card {
    background: rgba(30, 41, 59, 0.6);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 12px;
    transition: var(--transition);
}

.current-lesson-card {
    border-color: rgba(99, 102, 241, 0.4);
    animation: glowBox 2s ease-in-out infinite;
}

.lesson-status {
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

.no-notebook-text {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 8px;
    font-style: italic;
}

.notebook-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    margin-top: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.notebook-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.notebook-btn svg {
    flex-shrink: 0;
}

/* ====== REMOVE PURPLE HOVER BORDER ON COMPACT CARDS ====== */
.compact-card:hover {
    border-color: inherit !important;
}

.today-lesson-item:hover,
.exam-item:hover {
    border-color: inherit !important;
}

/* ====== FIX HOVER EFFECTS AND CARD STYLING ====== */
/* Re-enable glow on card hover */
.compact-card:hover {
    transform: translateY(0) !important;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5) !important;
    border-color: rgba(99, 102, 241, 0.6) !important;
}

/* Next lesson card - blue glow */
.next-lesson-card {
    border-color: rgba(99, 102, 241, 0.4);
    animation: glowBox 2s ease-in-out infinite;
}

/* Remove all hover borders from lesson items inside cards */
.lesson-info:hover {
    border-color: transparent !important;
    transform: none !important;
    background: transparent !important;
}

.today-lesson-item:hover {
    border-color: transparent !important;
    transform: translateX(0) !important;
    background: rgba(15, 23, 42, 0.4) !important;
}

.exam-item:hover {
    border-color: transparent !important;
    transform: translateX(0) !important;
    background: rgba(15, 23, 42, 0.4) !important;
}

/* Ensure lesson-info doesn't have conflicting styles */
.lesson-info.compact {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

/* ====== MODERN HOVER ANIMATIONS ====== */
/* Smooth transitions for all interactive elements */
.compact-card,
.today-lesson-item,
.exam-item,
.lesson-card,
.notebook-btn,
.lang-btn,
.notify-btn,
.search-button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced card hover with scale and glow */
.compact-card:hover {
    transform: translateY(-2px) scale(1.01) !important;
    box-shadow:
        0 12px 32px rgba(99, 102, 241, 0.6),
        0 0 40px rgba(99, 102, 241, 0.3) !important;
    border-color: rgba(99, 102, 241, 0.8) !important;
}

/* Lesson item hover with slide and glow */
.today-lesson-item:hover,
.exam-item:hover {
    transform: translateX(4px) scale(1.02) !important;
    background: rgba(15, 23, 42, 0.6) !important;
    box-shadow:
        -4px 0 16px rgba(99, 102, 241, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

/* Lesson card hover with pulse effect */
.lesson-card:hover {
    transform: scale(1.02);
    box-shadow:
        0 8px 24px rgba(99, 102, 241, 0.5),
        0 0 30px rgba(99, 102, 241, 0.2);
}

.current-lesson-card:hover {
    box-shadow:
        0 8px 24px rgba(99, 102, 241, 0.6),
        0 0 30px rgba(99, 102, 241, 0.3);
}

.next-lesson-card:hover {
    box-shadow:
        0 8px 24px rgba(99, 102, 241, 0.6),
        0 0 30px rgba(99, 102, 241, 0.3);
}

/* Button hover with lift and glow */
.notebook-btn:hover {
    transform: translateY(-3px) scale(1.05) !important;
    box-shadow:
        0 6px 20px rgba(99, 102, 241, 0.5),
        0 0 25px rgba(99, 102, 241, 0.3) !important;
}

.lang-btn:hover,
.notify-btn:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow:
        0 4px 16px rgba(99, 102, 241, 0.4),
        0 0 20px rgba(99, 102, 241, 0.2);
}

/* Search button hover effects */
.search-button:hover {
    transform: translateY(-2px) scale(1.1);
    filter: brightness(1.2);
    box-shadow:
        0 4px 12px currentColor,
        0 0 20px currentColor;
}

/* Countdown timer pulse on hover */
.lesson-countdown:hover {
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Smooth active state */
.compact-card:active {
    transform: translateY(0) scale(0.98) !important;
}

.notebook-btn:active,
.lang-btn:active,
.notify-btn:active,
.search-button:active {
    transform: translateY(0) scale(0.95) !important;
}

/* Focus styles for accessibility */
.compact-card:focus-within,
.notebook-btn:focus,
.lang-btn:focus,
.notify-btn:focus,
.search-button:focus {
    outline: 2px solid rgba(99, 102, 241, 0.6);
    outline-offset: 2px;
}

/* Show More Button */
.show-more-btn {
    width: 100%;
    margin-top: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.show-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.show-more-btn svg {
    transition: transform 0.3s ease;
}

.show-more-btn:hover svg {
    transform: translateY(2px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    margin: 5% auto;
    padding: 0;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    width: 90%;
    max-width: 1000px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    background: rgba(99, 102, 241, 0.05);
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: rotate(90deg);
}

/* Week Navigation Styles */
.week-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.week-nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.week-nav-btn:hover {
    background: rgba(99, 102, 241, 0.4);
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
}

.week-nav-btn:active {
    transform: translateY(0);
}

.week-nav-btn svg {
    flex-shrink: 0;
}

.week-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.week-range {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.week-today-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.week-today-btn:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

@media (max-width: 600px) {
    .week-navigation {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }

    .week-nav-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .week-info {
        order: -1;
    }

    .week-range {
        font-size: 14px;
    }
}

/* Weekly View Styles */
.weekly-content {
    padding: 24px 28px;
    max-height: calc(80vh - 100px);
    overflow-y: auto;
    padding-bottom: 50px;
}

.weekly-days {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    min-height: 400px;
}

@media (max-width: 1600px) {
    .weekly-days {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1200px) {
    .weekly-days {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .weekly-days {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .weekly-days {
        grid-template-columns: 1fr;
    }
}

.weekly-day {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

.weekly-day:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.weekly-day-header {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(99, 102, 241, 0.2);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weekly-day-lessons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.weekly-lesson-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 12px;
}

.weekly-lesson-item:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    transform: scale(1.02);
}

.weekly-lesson-item.weekly-lesson-cancelled {
    opacity: 0.6;
    text-decoration: line-through;
}

.weekly-lesson-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-color);
}

.weekly-lesson-info {
    flex: 1;
}

.weekly-lesson-title {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
    color: #e2e8f0;
    word-wrap: break-word;
    line-height: 1.3;
}

.weekly-lesson-meta {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.weekly-location {
    font-size: 10px;
    color: #94a3b8;
    padding: 2px 5px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
}

.weekly-exam-badge {
    font-size: 9px;
    font-weight: 600;
    color: #f59e0b;
    padding: 2px 5px;
    background: rgba(245, 158, 11, 0.15);
    border-radius: 4px;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.weekly-special-badge {
    font-size: 9px;
    font-weight: 600;
    color: #ef4444;
    padding: 2px 5px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 4px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}


.no-lessons {
    color: #94a3b8;
    font-style: italic;
    padding: 12px;
    text-align: center;
}

/* AI Chat Styles */
.ai-modal .modal-content {
    max-width: 700px;
}

.ai-chat-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
}

.ai-chat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.6);
}

.ai-chat-content {
    display: flex;
    flex-direction: column;
    height: 500px;
}

.ai-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.user-message {
    flex-direction: row-reverse;
}

.ai-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-message .ai-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.assistant-message .ai-avatar {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.ai-message-content {
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 70%;
    word-wrap: break-word;
    line-height: 1.5;
}

.user-message .ai-message-content {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 16px 16px 4px 16px;
}

.assistant-message .ai-message-content {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #e2e8f0;
    border-radius: 16px 16px 16px 4px;
}

.typing-indicator .ai-message-content {
    display: flex;
    gap: 4px;
    padding: 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.ai-input-area {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
    background: rgba(99, 102, 241, 0.03);
}

#aiInput {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    color: white;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    transition: all 0.3s ease;
}

#aiInput:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#aiInput::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.ai-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ai-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.ai-send-btn:active {
    transform: scale(0.95);
}

/* Scrollbar Styles for Modals */
.weekly-content::-webkit-scrollbar,
.ai-messages::-webkit-scrollbar {
    width: 8px;
}

.weekly-content::-webkit-scrollbar-track,
.ai-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.weekly-content::-webkit-scrollbar-thumb,
.ai-messages::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 10px;
}

.weekly-content::-webkit-scrollbar-thumb:hover,
.ai-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }

    .ai-chat-btn {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }

    .weekly-lesson-item {
        flex-direction: column;
        gap: 8px;
    }

    .weekly-lesson-time {
        min-width: auto;
    }

    .ai-message-content {
        max-width: 85%;
    }
}

/* ISY Authentication Styles */
.isy-btn {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary-color);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: 8px;
}

.isy-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: scale(1.05);
}

.isy-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.isy-modal .modal-content {
    max-width: 500px;
}

.isy-login-content {
    padding: 24px 28px;
}

.isy-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.isy-status {
    padding: 12px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    text-align: center;
}

.isy-status strong {
    color: var(--primary-color);
}

.label-input {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.label-input label {
    font-size: 14px;
    font-weight: 600;
    color: #cbd5e1;
}

.label-input input {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.label-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.label-input input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.label-input input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.stay-signed-in {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.stay-signed-in label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.stay-signed-in input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.isy-error {
    padding: 12px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    color: #ef4444;
    font-size: 14px;
}

.isy-buttons {
    display: flex;
    gap: 12px;
}

.isy-login-btn,
.isy-logout-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.isy-login-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.isy-login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.isy-login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.isy-logout-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.isy-logout-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: translateY(-2px);
}

.isy-messages {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
}

.isy-messages h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

#isyMessagesList {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.isy-message-item {
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    transition: all 0.3s ease;
    border-left: 3px solid rgba(99, 102, 241, 0.3);
}

.isy-message-item.priority-urgent {
    border-left-color: #ef4444;
}

.isy-message-item.priority-high {
    border-left-color: #f59e0b;
}

.isy-message-item.priority-normal {
    border-left-color: #6366f1;
}

.isy-message-item.priority-low {
    border-left-color: #64748b;
}

.isy-message-item:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(5px);
}

.isy-message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.isy-message-title {
    font-size: 15px;
    font-weight: 600;
    color: #e2e8f0;
    flex: 1;
}

.isy-message-priority {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.isy-message-priority.priority-urgent {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.isy-message-priority.priority-high {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.isy-message-priority.priority-normal {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.isy-message-priority.priority-low {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.priority-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.isy-message-body {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
    margin: 8px 0;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.isy-message-content {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.5;
}

.isy-message-date {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.isy-message-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.isy-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.isy-badge.completed {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.isy-badge.read {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.isy-badge.archived {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Close modal when clicking outside for ISY modal */
#isyModal.modal {
    cursor: pointer;
}

#isyModal .modal-content {
    cursor: default;
}

@media (max-width: 768px) {
    .isy-modal .modal-content {
        width: 95%;
    }
}

/* Dashboard Messages Styling (5th Column) */
.isy-dashboard-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.dashboard-message-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    border-left: 3px solid;
    transition: all 0.2s ease;
    cursor: pointer;
}

.dashboard-message-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.dashboard-message-item.priority-low {
    border-left-color: #64748b;
}

.dashboard-message-item.priority-normal {
    border-left-color: #6366f1;
}

.dashboard-message-item.priority-high {
    border-left-color: #f59e0b;
}

.dashboard-message-item.priority-urgent {
    border-left-color: #ef4444;
}

.dashboard-msg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.dashboard-msg-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unread-dot {
    color: #3b82f6;
    font-size: 0.6rem;
    flex-shrink: 0;
}

.dashboard-priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dashboard-priority-dot.low {
    background-color: #64748b;
}

.dashboard-priority-dot.normal {
    background-color: #6366f1;
}

.dashboard-priority-dot.high {
    background-color: #f59e0b;
}

.dashboard-priority-dot.urgent {
    background-color: #ef4444;
}

.dashboard-msg-author {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.dashboard-msg-preview {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dashboard-msg-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.info-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
    font-size: 0.9rem;
}

/* Responsive adjustments for 5 columns */
@media (max-width: 1600px) {
    .compact-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .compact-row .compact-card:nth-child(4),
    .compact-row .compact-card:nth-child(5) {
        grid-column: span 1;
    }
}

@media (max-width: 1200px) {
    .compact-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .compact-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Modern Message Detail Modal
   ======================================== */

.message-modal {
    max-width: 700px !important;
    border-radius: 16px !important;
}

.message-detail-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 80vh;
}

.message-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.message-detail-header.priority-urgent {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.15));
    border-bottom-color: rgba(239, 68, 68, 0.3);
}

.message-detail-header.priority-high {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.15));
    border-bottom-color: rgba(245, 158, 11, 0.3);
}

.message-header-content {
    flex: 1;
    padding-right: 16px;
}

.message-priority-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.message-priority-badge.low {
    background: rgba(100, 116, 139, 0.3);
    color: #94a3b8;
}

.message-priority-badge.normal {
    background: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.message-priority-badge.high {
    background: rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

.message-priority-badge.urgent {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.message-detail-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0;
}

.message-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.message-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.message-detail-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.message-author-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    margin-bottom: 20px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.author-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.author-group {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.message-content-wrapper {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.message-body-content {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.message-body-content p {
    margin: 0 0 12px 0;
}

.message-body-content p:last-child {
    margin-bottom: 0;
}

.message-body-content strong {
    color: white;
    font-weight: 600;
}

.message-body-content a {
    color: #818cf8;
    text-decoration: none;
}

.message-body-content a:hover {
    text-decoration: underline;
}

.message-attachments {
    background: rgba(99, 102, 241, 0.08);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.attachments-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 12px;
}

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

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.attachment-item:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateX(4px);
}

.attachment-item.pdf svg {
    color: #ef4444;
}

.attachment-item.image svg {
    color: #10b981;
}

.attachment-item.file svg {
    color: #6366f1;
}

.message-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.message-error-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    color: #fcd34d;
    font-size: 0.85rem;
    margin-top: 16px;
}

/* Responsive adjustments for message modal */
@media (max-width: 768px) {
    .message-modal {
        width: 95% !important;
        max-width: none !important;
    }

    .message-detail-header {
        padding: 16px;
    }

    .message-detail-body {
        padding: 16px;
    }

    .message-detail-title {
        font-size: 1.1rem;
    }

    .message-content-wrapper {
        padding: 16px;
    }
}

/* ========================================
   ISY Messages Header & Archive Toggle
   ======================================== */

.isy-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.isy-header-row h2 {
    margin: 0;
}

.msg-view-toggle {
    display: flex;
    gap: 4px;
    background: rgba(15, 23, 42, 0.6);
    padding: 4px;
    border-radius: 8px;
}

.msg-view-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.msg-view-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
}

.msg-view-btn.active {
    background: rgba(99, 102, 241, 0.3);
    color: var(--primary-color);
}

.msg-view-btn svg {
    flex-shrink: 0;
}

/* Archive button on message items */
.archive-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    opacity: 0;
    flex-shrink: 0;
}

.dashboard-message-item:hover .archive-btn {
    opacity: 1;
}

.archive-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    color: var(--primary-color);
}

.dashboard-msg-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .isy-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .msg-view-toggle {
        width: 100%;
    }

    .msg-view-btn {
        flex: 1;
        justify-content: center;
    }

    .archive-btn {
        opacity: 1;
    }
}

/* Message actions in modal */
.message-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
}

.message-archive-btn,
.message-open-isy-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.message-archive-btn {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary-color);
}

.message-archive-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.5);
}

.message-open-isy-btn {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.message-open-isy-btn:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.5);
}

.view-in-isy-btn {
    margin-left: auto;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.view-in-isy-btn:hover {
    background: rgba(99, 102, 241, 0.3);
}

/* Attachment item styling (non-clickable) */
.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
}