/* ========================================
   App-Specific Styles
   ======================================== */

/* Disable smooth scroll for app page */
html {
    scroll-behavior: auto !important;
}

.app-container {
    min-height: calc(100vh - 200px);
    padding: 2rem 0 4rem;
}

.app-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.main-content {
    width: 100%;
}

/* ========================================
   Dashboard Header
   ======================================== */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.dashboard-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Progress Container */
.progress-container {
    margin-top: 1.5rem;
}

.progress-bar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar-bg {
    width: 100%;
    height: 1rem;
    background: var(--bg-tertiary);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 1rem;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ========================================
   AI Insights Button & Modal
   ======================================== */

.nav-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.insights-modal {
    max-width: 600px;
}

.single-insights-body {
    padding: 2rem;
}

.insights-section {
    display: flex;
    flex-direction: column;
}

.insights-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.insights-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
}

.refresh-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn:hover {
    background: var(--gradient-primary);
    border-color: transparent;
    transform: rotate(180deg);
}

.recommendations-list,
.time-blocks-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recommendation-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-pink);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.3s ease;
}

.recommendation-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.recommendation-item.priority-critical {
    border-left-color: var(--color-critical);
}

.recommendation-item.priority-high {
    border-left-color: var(--color-high);
}

.recommendation-item.priority-medium {
    border-left-color: var(--color-medium);
}

.recommendation-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recommendation-reason {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.time-block-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.time-block-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-pink);
}

.time-block-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.time-block-time {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--accent-pink);
}

.time-block-assignment {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.time-block-duration {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.empty-recommendations,
.empty-time-blocks {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ========================================
   Stats Summary
   ======================================== */

.stats-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:active {
    transform: scale(0.97);
}

.stat-card.active-filter {
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.15s; }
.stat-card:nth-child(3) { animation-delay: 0.25s; }
.stat-card:nth-child(4) { animation-delay: 0.35s; }

.stat-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(236, 72, 153, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.stat-card:hover::before {
    width: 300px;
    height: 300px;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.stat-card.critical {
    border-color: var(--color-critical);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, transparent 100%);
}

.stat-card.high {
    border-color: var(--color-high);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.05) 0%, transparent 100%);
}

.stat-card.week {
    border-color: var(--color-medium);
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.05) 0%, transparent 100%);
}

.stat-card.total {
    border-color: var(--accent-pink);
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.05) 0%, transparent 100%);
}

.stat-icon {
    font-size: 2rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stat-card.critical .stat-value {
    color: var(--color-critical);
}

.stat-card.high .stat-value {
    color: var(--color-high);
}

.stat-card.week .stat-value {
    color: var(--color-medium);
}

.stat-card.total .stat-value {
    color: var(--accent-pink);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ========================================
   Assignments Section
   ======================================== */

.assignments-section {
    margin-top: 2rem;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-heading {
    font-size: 1.75rem;
    font-weight: 700;
}

.search-filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    min-width: 250px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

.filter-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-pink);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

.filter-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tag {
    background: var(--gradient-primary);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-tag-close {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.filter-tag-close:hover {
    opacity: 1;
}

.view-controls {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #1a1a1a;
}

[data-theme="dark"] .view-btn {
    color: white;
}

.view-btn:hover {
    background: var(--bg-secondary);
}

.view-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

/* ========================================
   Skeleton Loading States
   ======================================== */

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmerSkeleton 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes shimmerSkeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.skeleton-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.skeleton-badge {
    width: 80px;
    height: 24px;
}

.skeleton-title {
    width: 60%;
    height: 28px;
    margin-bottom: 1rem;
}

.skeleton-text {
    width: 100%;
    height: 16px;
    margin-bottom: 0.5rem;
}

.skeleton-text.short {
    width: 40%;
}

.skeleton-text.medium {
    width: 70%;
}

.loading-container {
    display: none;
}

.loading-container.active {
    display: block;
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: 1.5rem;
    margin: 2rem 0;
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   Assignments Grid
   ======================================== */

.assignments-grid {
    display: grid;
    gap: 1.5rem;
}

.assignments-grid.hidden {
    display: none;
}

/* ========================================
   View-Specific Layouts
   ======================================== */

/* Calendar View */
.calendar-group {
    margin-bottom: 2.5rem;
}

.calendar-date-header {
    font-size: 1.25rem;
    font-weight: 700;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-pink);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.calendar-assignments {
    display: grid;
    gap: 1rem;
    padding-left: 1rem;
}

/* Class View */
.class-group {
    margin-bottom: 2.5rem;
}

.class-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 700;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-pink);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.class-name {
    font-size: 1.25rem;
}

.class-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.class-assignments {
    display: grid;
    gap: 1rem;
    padding-left: 1rem;
}

/* Week View */
.week-view {
    display: grid;
    gap: 1.5rem;
}

.week-summary {
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-pink);
    border-radius: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 1.125rem;
}

.assignment-card {
    background: rgba(var(--bg-secondary-rgb), 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1.75rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
    transform-style: preserve-3d;
    perspective: 1000px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation delays */
.assignment-card:nth-child(1) { animation-delay: 0.1s; }
.assignment-card:nth-child(2) { animation-delay: 0.2s; }
.assignment-card:nth-child(3) { animation-delay: 0.3s; }
.assignment-card:nth-child(4) { animation-delay: 0.4s; }
.assignment-card:nth-child(5) { animation-delay: 0.5s; }
.assignment-card:nth-child(6) { animation-delay: 0.6s; }
.assignment-card:nth-child(7) { animation-delay: 0.7s; }
.assignment-card:nth-child(8) { animation-delay: 0.8s; }
.assignment-card:nth-child(9) { animation-delay: 0.9s; }
.assignment-card:nth-child(10) { animation-delay: 1s; }

.assignment-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(236, 72, 153, 0.1), transparent);
    transition: left 0.5s ease;
}

.assignment-card:hover::after {
    left: 100%;
}

.assignment-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--border-color);
    transition: all 0.3s ease;
}

.assignment-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 20px 40px rgba(236, 72, 153, 0.15);
    border-color: rgba(236, 72, 153, 0.3);
}

.assignment-card.priority-critical {
    border-color: var(--color-critical);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, transparent 100%);
}

.assignment-card.priority-critical::before {
    background: var(--color-critical);
}

.assignment-card.priority-high {
    border-color: var(--color-high);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.05) 0%, transparent 100%);
}

.assignment-card.priority-high::before {
    background: var(--color-high);
}

.assignment-card.priority-medium {
    border-color: var(--color-medium);
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.05) 0%, transparent 100%);
}

.assignment-card.priority-medium::before {
    background: var(--color-medium);
}

.assignment-card.priority-low {
    border-color: var(--color-low);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, transparent 100%);
}

.assignment-card.priority-low::before {
    background: var(--color-low);
}

/* Completed assignment styles */
.assignment-card.status-completed {
    opacity: 0.6;
    animation: completePulse 0.6s ease-out;
}

@keyframes completePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(34, 197, 94, 0.5);
        border-color: var(--color-low);
    }
    100% {
        transform: scale(1);
    }
}

.assignment-card.status-completed .card-content h3 {
    text-decoration: line-through;
    color: var(--text-secondary);
    animation: strikeThrough 0.4s ease-out;
}

@keyframes strikeThrough {
    from {
        text-decoration-color: transparent;
    }
    to {
        text-decoration-color: var(--text-secondary);
    }
}

.assignment-card.status-completed .card-meta {
    opacity: 0.7;
}

.assignment-card.status-in_progress {
    border-left: 4px solid var(--accent-pink);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.priority-badge {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.priority-badge.critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-critical);
    border: 1px solid var(--color-critical);
}

.priority-badge.high {
    background: rgba(249, 115, 22, 0.15);
    color: var(--color-high);
    border: 1px solid var(--color-high);
}

.priority-badge.medium {
    background: rgba(234, 179, 8, 0.15);
    color: var(--color-medium);
    border: 1px solid var(--color-medium);
}

.priority-badge.low {
    background: rgba(34, 197, 94, 0.15);
    color: var(--color-low);
    border: 1px solid var(--color-low);
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Status Dropdown */
.status-dropdown {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.status-dropdown::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(236, 72, 153, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.status-dropdown:active::before {
    width: 200px;
    height: 200px;
}

.status-dropdown:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-pink);
    transform: translateY(-2px);
}

.status-dropdown:focus {
    outline: none;
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

.icon-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--bg-primary);
    transform: scale(1.1);
}

.icon-btn.edit:hover {
    background: rgba(236, 72, 153, 0.1);
    border-color: #ec4899;
    color: #ec4899;
}

.icon-btn.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--color-critical);
    color: var(--color-critical);
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.meta-icon {
    font-size: 1rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

.time-remaining {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.time-remaining.urgent {
    color: var(--color-critical);
    font-weight: 600;
}

.priority-score {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ========================================
   Notes Section
   ======================================== */

.notes-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.notes-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.notes-content {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    background: var(--bg-tertiary);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border-left: 3px solid var(--accent-pink);
}

/* ========================================
   Progress Section (In-Progress Assignments)
   ======================================== */

.progress-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.progress-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.progress-input {
    width: 5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-pink);
    text-align: center;
    transition: all 0.3s ease;
}

.progress-input:hover {
    border-color: var(--accent-pink);
}

.progress-input:focus {
    outline: none;
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.15);
}

.progress-bar-container {
    margin-top: 0rem;
}

.progress-bar-track {
    width: 100%;
    height: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-bar-filled {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 1rem;
    transition: width 0.3s ease;
}

/* ========================================
   Modal
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: translateY(50px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-form {
    padding: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.required {
    color: var(--color-critical);
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="datetime-local"],
.form-group input[type="number"],
.form-group textarea {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.form-group input:hover,
.form-group textarea:hover {
    border-color: var(--accent-pink);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
    transform: translateY(-2px);
}

/* Time Presets */
.time-presets {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.time-preset-btn {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.time-preset-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-pink);
    color: var(--accent-pink);
}

.time-preset-btn:active {
    transform: scale(0.95);
}

/* Slider with Number Input */
.slider-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.slider {
    flex: 1;
    height: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 1rem;
    outline: none;
    -webkit-appearance: none;
}

.number-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.slider-number-input {
    width: 4.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    transition: all 0.3s ease;
}

.slider-number-input:focus {
    outline: none;
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

.input-suffix {
    position: absolute;
    right: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    background: var(--gradient-primary);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
}

.slider::-moz-range-thumb {
    width: 1.25rem;
    height: 1.25rem;
    background: var(--gradient-primary);
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: var(--shadow-md);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
}

.helper-text {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   Welcome Modal
   ======================================== */

.welcome-modal {
    max-width: 900px;
    background: var(--bg-primary);
    animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.welcome-header {
    text-align: center;
    padding: 3rem 2rem 2rem;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.05) 0%, transparent 100%);
    border-bottom: 2px solid var(--border-color);
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.welcome-content {
    padding: 2rem;
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.welcome-feature {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-feature:hover {
    transform: translateY(-5px);
    border-color: var(--accent-pink);
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.15);
}

.feature-icon-large {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.welcome-feature h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.welcome-feature p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.welcome-demo-option {
    text-align: center;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.welcome-demo-option h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.welcome-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.welcome-buttons .btn {
    min-width: 180px;
}

.welcome-hint {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-top: 1rem;
}

/* ========================================
   Monthly Calendar View
   ======================================== */

.monthly-calendar {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 2rem;
    margin-top: 1rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.calendar-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.calendar-header button {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-header button:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    transform: scale(1.1);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day-label {
    text-align: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 0.75rem;
    text-transform: uppercase;
}

.calendar-day {
    position: relative;
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 80px;
}

.calendar-day:hover {
    background: var(--bg-primary);
    border-color: var(--accent-pink);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.calendar-day.other-month {
    opacity: 0.3;
    pointer-events: none;
}

.calendar-day.today {
    border: 2px solid var(--accent-pink);
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.1) 0%, transparent 100%);
}

.calendar-day.has-assignments {
    border-color: var(--accent-pink);
}

.day-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.calendar-day.today .day-number {
    color: var(--accent-pink);
    font-weight: 700;
}

.day-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: auto;
}

.day-indicator {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.day-indicator.critical {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--color-critical);
    color: var(--color-critical);
}

.day-indicator.high {
    background: rgba(249, 115, 22, 0.1);
    border-color: var(--color-high);
    color: var(--color-high);
}

.day-indicator.completed {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--color-low);
    color: var(--color-low);
}

/* Day Modal */
.day-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.day-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.day-modal {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 1.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: translateY(50px);
    transition: transform 0.3s ease;
}

.day-modal-overlay.active .day-modal {
    transform: translateY(0);
}

.day-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.day-modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.day-modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.day-modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.day-modal-content {
    padding: 1.5rem;
}

.day-modal-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.day-modal-assignment {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.day-modal-assignment:last-child {
    margin-bottom: 0;
}

.day-modal-assignment h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.day-modal-assignment .meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ========================================
   Tutorial Tooltips
   ======================================== */

.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--bg-primary);
    border: 2px solid var(--accent-pink);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    min-width: 250px;
    max-width: 350px;
    box-shadow: 0 10px 40px rgba(236, 72, 153, 0.3);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tooltip.active {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-top-color: var(--accent-pink);
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.tooltip-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-pink);
}

.tooltip-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.tooltip-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tooltip-content {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.tooltip-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.tooltip-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tooltip-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.tooltip-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tooltip-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.tooltip-progress-text {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.tooltip-progress-dots {
    display: flex;
    gap: 0.25rem;
}

.tooltip-progress-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    transition: all 0.3s ease;
}

.tooltip-progress-dot.active {
    background: var(--accent-pink);
    transform: scale(1.2);
}

/* ========================================
   Footer
   ======================================== */

.app-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.app-footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ========================================
   Pomodoro Timer Widget
   ======================================== */

.pomodoro-bubble {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
    z-index: 9998;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulse 2s ease-in-out infinite;
}

.pomodoro-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(239, 68, 68, 0.5);
}

.pomodoro-bubble:active {
    transform: scale(0.95);
}

.timer-icon {
    font-size: 2rem;
}

.pomodoro-window {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 350px;
    max-width: calc(100vw - 4rem);
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pomodoro-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.pomodoro-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    color: white;
    border-radius: 1.3rem 1.3rem 0 0;
}

.pomodoro-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pomodoro-icon {
    font-size: 2rem;
}

.pomodoro-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.pomodoro-status {
    font-size: 0.75rem;
    opacity: 0.9;
    margin: 0.25rem 0 0 0;
}

.pomodoro-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pomodoro-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.pomodoro-content {
    padding: 2rem 1.5rem 1.5rem;
}

.timer-display {
    font-size: 4rem;
    font-weight: 800;
    text-align: center;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(239, 68, 68, 0.2);
}

.timer-mode-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 0.75rem;
    padding: 0.25rem;
}

.mode-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.mode-btn.active {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.timer-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.timer-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.875rem;
}

.timer-btn.primary {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.timer-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.timer-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.timer-btn.secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-pink);
}

.timer-assignment-link {
    margin-bottom: 1.5rem;
}

.link-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.assignment-select {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.assignment-select:focus {
    outline: none;
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.timer-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.timer-stats .stat-item {
    text-align: center;
}

.timer-stats .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ef4444;
}

.timer-stats .stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ========================================
   AI Chat Assistant
   ======================================== */

.ai-chat-bubble {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.4);
    z-index: 9998;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulse 2s ease-in-out infinite;
}

.ai-chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(236, 72, 153, 0.5);
}

.ai-chat-bubble:active {
    transform: scale(0.95);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(236, 72, 153, 0.4);
    }
    50% {
        box-shadow: 0 8px 24px rgba(236, 72, 153, 0.6), 0 0 0 8px rgba(236, 72, 153, 0.1);
    }
}

.chat-icon {
    font-size: 2rem;
    animation: wave 1.5s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-20deg); }
}

.ai-chat-window {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 380px;
    max-width: calc(100vw - 4rem);
    height: 550px;
    max-height: calc(100vh - 4rem);
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 1.3rem 1.3rem 0 0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-avatar {
    font-size: 2rem;
}

.chat-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.chat-status {
    font-size: 0.75rem;
    opacity: 0.9;
    margin: 0.25rem 0 0 0;
}

.chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    animation: messageSlideIn 0.3s ease-out;
}

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

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

.message-avatar {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.message-content {
    background: var(--bg-secondary);
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    max-width: 75%;
    font-size: 0.875rem;
    line-height: 1.5;
}

.user-message .message-content {
    background: var(--gradient-primary);
    color: white;
}

.message-content ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.message-content li {
    margin: 0.25rem 0;
}

.chat-quick-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
    flex-wrap: wrap;
}

.quick-action-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-pink);
    transform: translateY(-2px);
}

.chat-input-container {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.chat-input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.2s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

.chat-send-btn {
    background: var(--gradient-primary);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.4);
}

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

/* ========================================
   Pull to Refresh Indicator
   ======================================== */

.pull-refresh-indicator {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.refresh-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.refresh-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

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

/* ========================================
   Dashboard Modal
   ======================================== */

.dashboard-modal {
    max-width: 1000px;
    width: 95%;
}

.dashboard-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 2rem;
}

.dashboard-section {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
}

.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Stress Level */
.stress-section {
    grid-column: 1 / -1;
}

.stress-meter {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stress-bar-container {
    width: 100%;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stress-bar {
    height: 100%;
    border-radius: 999px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, #22c55e, #eab308, #f97316, #ef4444);
    position: relative;
}

.stress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.stress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stress-label {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-pink);
}

.stress-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Pie Chart */
.pie-chart-container {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.pie-chart {
    width: 200px;
    height: 200px;
    transform: rotate(-90deg);
}

.pie-background {
    fill: var(--bg-tertiary);
}

.pie-segment {
    transition: all 0.3s ease;
    cursor: pointer;
}

.pie-segment:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.pie-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

.legend-label {
    font-size: 0.875rem;
    color: var(--text-primary);
    flex: 1;
}

.legend-value {
    font-weight: 700;
    color: var(--accent-pink);
}

/* Productivity Chart */
.productivity-chart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chart-bars {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    height: 200px;
    align-items: flex-end;
}

.chart-bar {
    background: linear-gradient(180deg, var(--accent-pink), #ec4899);
    border-radius: 0.5rem 0.5rem 0 0;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 4px;
}

.chart-bar:hover {
    opacity: 0.8;
    transform: translateY(-4px);
}

.chart-bar::after {
    content: attr(data-value);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.chart-labels {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Time Stats */
.time-stats-section {
    grid-column: 1 / -1;
}

.time-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.time-stat-card {
    background: var(--bg-tertiary);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.time-stat-card:hover {
    border-color: var(--accent-pink);
    transform: translateY(-4px);
}

.time-stat-icon {
    font-size: 2rem;
}

.time-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-pink);
}

.time-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1024px) {
    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .dashboard-body {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem;
    }

    .pie-chart-container {
        flex-direction: column;
    }

    .time-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Remove extra padding */
    .app-container {
        padding-bottom: 2rem;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start;
    }

    .dashboard-title {
        font-size: 2rem;
    }

    .stats-summary {
        grid-template-columns: 1fr;
    }

    .section-header-row {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

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

    .modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header,
    .modal-form {
        padding: 1.5rem;
    }

    .calendar-day {
        min-height: 60px;
        padding: 0.5rem;
    }

    .day-number {
        font-size: 0.75rem;
    }

    .day-indicator {
        font-size: 0.65rem;
        padding: 0.1rem 0.25rem;
    }
}

@media (max-width: 480px) {
    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}
