* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --gray-color: #95a5a6;
    --danger-color: #e74c3c;
    --blue: #1a73e8;
    --green: #33b679;
    --orange: #f4511e;
    --bg-dark: #1a1a2e;
    --bg-darker: #0f0f1e;
    --text-light: #e0e0e0;
}

body.dark-mode {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #000;
    background: #000;
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-image 0.6s ease, background 0.6s ease;
    overflow: hidden;
}

html {
    overflow: hidden;
}

.dashboard {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* === VENSTRE SIDE: KALENDER === */
.calendar-side {
    flex: 1;
    padding: 30px 40px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.1);
}

.time-info {
    margin-bottom: 40px;
}

.current-time {
    font-size: 3.5rem;
    font-weight: 300;
    color: white;
    line-height: 1;
    letter-spacing: -2px;
}

.current-date {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-top: 10px;
    text-transform: lowercase;
}

.calendar-compact {
    flex: 1;
    overflow: hidden;
    padding-right: 15px;
}

.calendar-compact::-webkit-scrollbar {
    display: none;
}

.calendar-compact {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.events-compact {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.day-group {
    margin-bottom: 15px;
}

.day-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.day-number {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 5px;
}

.event-compact {
    padding: 8px 12px;
    margin-bottom: 4px;
    border-left: 3px solid;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: default;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.event-compact:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.event-compact.all-day {
    background: rgba(255, 255, 255, 0.08);
}

.event-time-compact {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    min-width: 40px;
    font-weight: 500;
}

.event-content-compact {
    flex: 1;
    min-width: 0;
}

.event-title-compact {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-desc-compact {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* Color indicators */
.event-compact.color-blue { border-left-color: var(--blue); }
.event-compact.color-green { border-left-color: var(--green); }
.event-compact.color-orange { border-left-color: var(--orange); }

.refresh-btn-container {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

.btn-refresh {
    width: 100%;
    padding: 12px;
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.4);
    color: var(--primary-color);
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-refresh:hover {
    background: rgba(52, 152, 219, 0.3);
    border-color: rgba(52, 152, 219, 0.6);
}

/* === HØYRE SIDE: SIDEBARS === */
.sidebar-right {
    flex: 0 0 400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.08);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-section {
    padding: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-section h2 {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 15px;
    font-weight: 600;
}

.todoist-placeholder {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === LOADING & ERROR === */
.loading {
    text-align: center;
    color: var(--text-light);
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: var(--danger-color);
    color: white;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    margin: 20px 0;
}

/* === SCROLLBAR STYLING === */
.calendar-side::-webkit-scrollbar {
    width: 6px;
}

.calendar-side::-webkit-scrollbar-track {
    background: transparent;
}

.calendar-side::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.calendar-side::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-right::-webkit-scrollbar {
    display: none;
}

.sidebar-right {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .calendar-side {
        padding: 25px 30px;
    }

    .current-time {
        font-size: 2.5rem;
    }

    .sidebar-right {
        flex: 0 0 320px;
    }

    .sidebar-section {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }

    .calendar-side {
        flex: 1;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        max-height: 50%;
    }

    .sidebar-right {
        flex: 1;
        flex-direction: row;
        border-left: none;
        overflow-x: auto;
        max-height: 50%;
    }

    .sidebar-section {
        flex: 0 0 50%;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }

    .sidebar-section:last-child {
        border-right: none;
    }

    .current-time {
        font-size: 2rem;
    }

    .current-date {
        font-size: 0.9rem;
    }

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

    .event-title-compact {
        font-size: 0.85rem;
    }
}
