:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --sidebar-bg: rgba(15, 23, 42, 0.8);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-work: #6366f1; /* Indigo */
    --accent-break: #10b981; /* Emerald */
    --accent-color: var(--accent-work);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
    background-image: radial-gradient(circle at top right, #1e1b4b, transparent),
                      radial-gradient(circle at bottom left, #064e3b, transparent);
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

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

.logo h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #818cf8, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-links li button {
    width: 100%;
    padding: 0.875rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

.nav-links li.active button {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    box-shadow: inset 0 0 0 1px var(--glass-border);
}

.nav-links li button:hover:not(.active button) {
    background: rgba(255, 255, 255, 0.05);
}

/* Main Content */
.content {
    flex: 1;
    padding: 3rem;
    overflow-y: auto;
    position: relative;
}

.view {
    display: none;
    animation: fadeIn 0.5s ease;
}

.view.active {
    display: block;
}

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

/* Timer View */
.timer-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    box-shadow: var(--glass-shadow);
}

.session-info h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.session-info p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.timer-display {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.3s ease, stroke 0.3s ease;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.time-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 700;
}

.timer-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.primary-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 14px;
    font-weight: 600;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.text-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    transition: color 0.3s ease;
}

.text-btn:hover {
    color: var(--text-primary);
}

.hidden {
    display: none !important;
}

/* Calendar View */
.calendar-container {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--glass-shadow);
}

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

.calendar-nav button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-nav button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.03);
}

.day:hover {
    background: rgba(255, 255, 255, 0.1);
}

.day.today {
    box-shadow: inset 0 0 0 2px var(--accent-work);
}

.day.has-activity::after {
    content: '';
    position: absolute;
    bottom: 6px;
    width: 4px;
    height: 4px;
    background: var(--accent-break);
    border-radius: 50%;
}

.day.selected {
    background: var(--accent-work);
    color: white;
}

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

.day-details {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
}

.activity-list {
    list-style: none;
    margin-top: 1rem;
}

.activity-item {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-item:last-child {
    border-bottom: none;
}

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

/* 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: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: #1e293b;
    padding: 2.5rem;
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.modal-content h2 {
    margin-bottom: 1rem;
    font-family: var(--font-heading);
}

.modal-content textarea {
    width: 100%;
    height: 120px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    color: white;
    font-family: inherit;
    margin: 1.5rem 0;
    resize: none;
}

.modal-content textarea:focus {
    outline: none;
    border-color: var(--accent-work);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        padding: 1rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }
    .nav-links {
        flex-direction: row;
    }
    .content {
        padding: 1.5rem;
    }
}
