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

:root {
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fff;
}

#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.container {
    background: rgba(15, 23, 42, 0.6);
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 0 100px rgba(79, 70, 229, 0.1);
    backdrop-filter: blur(12px);
    width: min(90%, 500px);
    position: relative;
    z-index: 2;
    animation: floatContainer 6s ease-in-out infinite;
}

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

.group-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    justify-content: center;
    position: relative;
    z-index: 3;
}

button {
    padding: 0.875rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

button:active {
    transform: translateY(0);
}

button.active {
    background: var(--primary);
    color: white;
    box-shadow: 
        0 0 20px rgba(var(--primary), 0.3),
        0 2px 8px rgba(0, 0, 0, 0.2);
}

button.active::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        rgba(255, 255, 255, 0.2),
        transparent,
        transparent
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

.group-selector button {
    padding: 0.875rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(4px);
}

.group-selector button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        0 0 20px rgba(79, 70, 229, 0.2);
}

.group-selector button.active {
    background: var(--primary);
    color: white;
    box-shadow: 
        0 0 30px var(--primary),
        0 2px 8px rgba(0, 0, 0, 0.2);
    animation: pulseButton 2s infinite;
}

@keyframes pulseButton {
    0% { box-shadow: 0 0 30px var(--primary), 0 2px 8px rgba(0, 0, 0, 0.2); }
    50% { box-shadow: 0 0 50px var(--primary), 0 2px 8px rgba(0, 0, 0, 0.2); }
    100% { box-shadow: 0 0 30px var(--primary), 0 2px 8px rgba(0, 0, 0, 0.2); }
}

.timer-display {
    text-align: center;
    position: relative;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.timer-display.during-lecture {
    background: rgba(239, 68, 68, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    transform: scale(1.02);
    box-shadow: 
        0 0 50px rgba(239, 68, 68, 0.2),
        0 0 100px rgba(239, 68, 68, 0.1);
}

.timer-display.during-lecture #timer {
    font-size: 4.2rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.timer-display.during-lecture #timerStatus {
    font-size: 1.4rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
}

/* Adjust the timer status position */
#timerStatus {
    font-size: 1.3rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    letter-spacing: 0.5px;
    position: relative;
    top: -4rem; /* Adjusted to move the title higher */
    z-index: 3;
}

/* Center the timer text inside the timer ring */
#timer {
    font-size: 3.8rem;
    font-weight: 700;
    background: linear-gradient(to right bottom, #fff, rgba(255, 255, 255, 0.7));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 1rem;
    margin: 1rem 0;
    transition: all 0.3s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    white-space: nowrap;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* Adjust the timer text size for before lecture */
.timer-display:not(.during-lecture) #timer {
    font-size: 2.5rem;
}

#timer.urgent {
    animation: pulseUrgent 1s ease-in-out infinite;
    text-shadow: 0 0 30px var(--danger);
}

@keyframes pulseUrgent {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        text-shadow: 0 0 30px var(--danger);
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.05);
        text-shadow: 0 0 50px var(--danger);
    }
}

#timer.warning {
    color: var(--warning);
}

#timer.normal {
    color: var(--success);
}

/* Hide the timer ring initially */
.timer-ring {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    height: 320px;
    background: conic-gradient(
        from 0deg, /* Changed from -90deg to 0deg */
        var(--primary) var(--progress),
        rgba(255, 255, 255, 0.05) 0
    );
    border-radius: 50%;
    box-shadow: 0 0 50px rgba(var(--primary), 0.3);
    transition: all 0.3s ease;
}

/* Show the timer ring during the lecture */
.timer-display.during-lecture .timer-ring {
    display: block;
}

.timer-ring::before {
    content: '';
    position: absolute;
    inset: 15px;
    background: #1e293b;
    border-radius: 50%;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

@keyframes progress {
    from {
        transform: rotate(-90deg);
    }
    to {
        transform: rotate(calc(-90deg + (var(--progress) * 360deg)));
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shine {
    0% {
        left: -50%;
    }
    100% {
        left: 100%;
    }
}

@keyframes pulseColor {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Settings styles are preserved for future use */
.settings {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 2rem;
}

.settings-group {
    margin-bottom: 1rem;
}

.settings-group.hidden {
    display: none;
}

.time-settings {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.time-settings div {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

label {
    min-width: 100px;
    color: rgba(255, 255, 255, 0.7);
}

select, input[type="time"] {
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    flex: 1;
}
