/* --- APP BACKGROUND FOR GRADIENT --- */
body.schedule-page {
    background: linear-gradient(135deg, #e0f2ff 0%, #fef0fa 50%, #e0ffe8 100%);
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow: hidden;
}

.app-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--right-panel-width);
    height: 100vh;
    background: transparent;
    box-sizing: border-box;
    overflow: hidden;
}

/* No overrides needed for .sidebar as it now uses global sidebar.css defaults */

/* Main Content */
.main-content {
    background: transparent !important;
    border: none;
    box-shadow: none;
    padding: 30px 40px; /* Increased padding */
    display: flex;
    flex-direction: column;
    height: 100vh;
    box-sizing: border-box;
}

.top-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.top-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #111;
    margin: 0;
}

.status-circle {
    width: 15px;
    height: 15px;
    border: 2px solid #45D48B;
    border-radius: 50%;
    margin-left: 15px;
}

.calendar-large {
    background: var(--white);
    padding: 30px;
    border-radius: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.02);
    flex: 1; /* Match remaining height */
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.schedule-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.schedule-toolbar h2 {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    display: inline-block;
    margin: 0;
}

#main-month-year {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    margin-right: 5px;
}

.toolbar-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-monthly {
    border: 1px solid #eee;
    background: transparent;
    padding: 8px 15px;
    border-radius: 8px;
    color: #555;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.view-toggles {
    display: flex;
    gap: 10px;
    color: #aaa;
    font-size: 18px;
}

.view-toggles .active {
    color: #45D48B;
    background: #e0f8ec;
    padding: 6px;
    border-radius: 6px;
}

.month-picker-dropdown {
    position: absolute;
    top: 45px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 15px;
    width: 300px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    z-index: 100;
}

.month-picker-dropdown.hidden {
    display: none;
}

.month-option {
    padding: 10px 5px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.month-option:hover {
    background: #6174FF;
    color: white;
    box-shadow: 0 4px 10px rgba(97, 116, 255, 0.3);
}

.horizontal-calendar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 20px;
}

.nav-arrow {
    color: #333;
    font-size: 14px;
    cursor: pointer;
}

.days-strip {
    display: flex;
    flex: 1;
    justify-content: space-between;
    overflow: hidden;
    padding: 0 10px;
}

.day-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 45px;
}

.day-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    color: #333;
    background: #f8f9fa;
    transition: 0.3s;
    cursor: pointer;
}

.day-col:hover .day-num {
    background: #e0e0e0;
}

.day-col.active .day-num {
    background: #6174FF;
    color: white;
    box-shadow: 0 4px 10px rgba(97, 116, 255, 0.4);
}

.day-name {
    font-size: 11px;
    color: #aaa;
    font-weight: 500;
}

.schedule-grid-container {
    flex: 1;
    display: flex;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.schedule-grid-container::-webkit-scrollbar {
    width: 6px;
}

.schedule-grid-container::-webkit-scrollbar-thumb {
    background: #eee;
    border-radius: 10px;
}

.time-column {
    width: 60px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
}

.time-slot {
    height: 60px;
    font-size: 12px;
    color: #aaa;
    font-weight: 500;
    display: flex;
    justify-content: center;
}

.schedule-grid {
    flex: 1;
    position: relative;
}

.grid-lines {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
}

.grid-line {
    height: 60px;
    border-top: 1px dashed #f0f0f0;
    width: 100%;
    box-sizing: border-box;
}

.events-container {
    position: absolute;
    inset: 0;
    padding-top: 10px;
}

.event-card {
    position: absolute;
    left: 20px;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 12px;
    width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s;
}

.event-card:hover {
    transform: scale(1.02);
    z-index: 10;
}

.event-card h4 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: inherit;
}

.event-card p {
    font-size: 11px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    color: inherit;
    opacity: 0.8;
}

/* Dynamic classes to be added by JS for specific colors */
.event-card[data-theme="green"] {
    background: #f0fdf4;
    color: #45D48B;
    border-left: 4px solid #45D48B;
}

.event-card[data-theme="orange"] {
    background: #fff7ed;
    color: #f97316;
    border-left: 4px solid #f97316;
}

.event-card[data-theme="purple"] {
    background: #f5f3ff;
    color: #8b5cf6;
    border-left: 4px solid #8b5cf6;
}

/* Right Panel */
.right-panel {
    background: var(--white) !important;
    padding: 30px 25px;
    display: flex;
    flex-direction: column;
}

.profile-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.profile-header .fa-bell {
    color: #888;
    font-size: 20px;
    position: relative;
    cursor: pointer;
}

.profile-header .fa-bell::after {
    content: '';
    position: absolute;
    top: 0;
    right: 2px;
    width: 6px;
    height: 6px;
    background: red;
    border-radius: 50%;
    border: 2px solid white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.mini-calendar {
    margin-bottom: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #111;
    margin: 0;
}

.calendar-header .nav {
    display: flex;
    gap: 15px;
    color: #aaa;
    cursor: pointer;
    font-size: 12px;
}

.week-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 11px;
    color: #a0a0a0;
    margin-bottom: 10px;
    font-weight: 500;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 10px 0;
}

.days-grid>span {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    width: 30px;
    height: 30px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
}

.days-grid>span:hover:not(.muted) {
    background: #f0f0f0;
}

.days-grid>span.muted {
    color: #d0d0d0;
    font-weight: 400;
}

.days-grid>span.active {
    background: #6174FF;
    color: white;
    box-shadow: 0 4px 10px rgba(97, 116, 255, 0.4);
}

.btn-add-task {
    width: 100%;
    padding: 15px;
    background: #45D48B;
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 25px;
    box-shadow: 0 8px 20px rgba(69, 212, 139, 0.3);
    transition: 0.3s;
}

.btn-add-task:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(69, 212, 139, 0.4);
}

.stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.stat-item {
    flex: 1;
    text-align: center;
}

.stat-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: 700;
    font-size: 15px;
}

.stat-circle.blue {
    border: 2px solid #e0e4ff;
    color: #6174FF;
    background: #f5f7ff;
}

.stat-circle.green {
    border: 2px solid #e0f8ec;
    color: #45D48B;
    background: #f0fdf4;
}

.stat-item p {
    font-size: 10px;
    color: #888;
    font-weight: 500;
    margin: 0;
}

.reminders-section {
    flex: 1;
    overflow-y: auto;
}

.reminders-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    margin-top: 0;
    color: #111;
}

.task-card {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.task-card:last-child {
    border-bottom: none;
}

.task-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-right: 15px;
}

.task-icon.orange {
    background: #fff5eb;
    color: #ed8936;
}

.task-icon.green {
    background: #e0f8ec;
    color: #45D48B;
}

.task-detail {
    flex: 1;
}

.task-detail h4 {
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #333;
}

.task-detail p {
    font-size: 11px;
    color: #a0a0a0;
    font-weight: 500;
    margin: 0;
}

.task-card>i {
    color: #ccc;
    cursor: pointer;
    font-size: 14px;
}

/* MODAL STYLES */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.visible {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 500px;
    max-width: 95%;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
    position: relative;
    box-sizing: border-box;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 24px;
    color: #aaa;
    cursor: pointer;
}

.modal-content h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #111;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: #555;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #6174FF;
}

.row {
    display: flex;
    gap: 10px;
}

.col {
    flex: 1;
    min-width: 0;
}

.btn-save {
    width: 100%;
    padding: 12px;
    background: #6174FF;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

.custom-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    color: #333;
    transform: translateX(150%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2000;
    border-left: 4px solid #45D48B;
}

.custom-notification.show {
    transform: translateX(0);
}

.custom-notification i {
    color: #45D48B;
    font-size: 20px;
}

/* ── RESPONSIVE DESIGN ── */
@media (max-width: 1200px) {
    .app-container { grid-template-columns: var(--sidebar-width) 1fr 280px; }
    .main-content { padding: 20px; }
}

@media (max-width: 1024px) {
    body.schedule-page, .app-container { overflow: auto; height: auto; }
    .app-container { grid-template-columns: 1fr 300px; }
    .mobile-only-header { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
    .desktop-toolbar { display: none; }
    .mobile-toggle {
        display: flex; background: #6174FF; color: white; border: none;
        width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
        align-items: center; justify-content: center; font-size: 18px;
    }
}

@media (max-width: 768px) {
    .app-container { display: block; }
    .right-panel {
        width: 100%; padding: 20px; border-left: none;
        border-top: 1px solid rgba(0,0,0,0.05); height: auto;
    }
    .schedule-grid-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .schedule-grid { min-width: 600px; }
}

.sidebar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px); z-index: 999; display: none;
    opacity: 0; transition: opacity 0.3s;
}
.sidebar-overlay.active { display: block; opacity: 1; }
.mobile-only-header { display: none; }