:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-color: #a855f7;
    --primary-hover: #9333ea;
    --blob-1: #c084fc;
    --blob-2: #3b82f6;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

h1,
h2,
h3 {
    font-family: 'Outfit', sans-serif;
}

/* Background Animations */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--blob-1);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--blob-2);
    bottom: -200px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, 50px) scale(1.2);
    }
}

/* Hamburger Menu */
.hamburger-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

#menu-toggle {
    display: none;
}

.menu-icon {
    font-size: 2rem;
    cursor: pointer;
    color: #fdf4ff;
    text-shadow: 0 0 10px rgba(232, 121, 249, 0.5);
    transition: transform 0.3s;
    position: relative;
    z-index: 1001; /* Keep above drawer */
}

.menu-icon:hover {
    transform: scale(1.1);
}

.menu-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#menu-toggle:checked ~ .menu-overlay {
    opacity: 1;
    visibility: visible;
}

.menu-content {
    position: fixed;
    top: 0;
    right: 0;
    width: 75vw;
    max-width: 300px;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(232, 121, 249, 0.3);
    padding: 6rem 2rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 999;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.05);
}

#menu-toggle:checked ~ .menu-content {
    transform: translateX(0);
}

.menu-content h2 {
    color: #f8fafc;
    margin-bottom: 1rem;
    font-family: 'Outfit', sans-serif;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 1rem;
}

.menu-content a {
    color: #e9d5ff;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
}

.menu-content a:hover {
    color: #e879f9;
    transform: translateX(5px);
}

/* App Container */
.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Glassmorphism Classes */
.glass-header,
.glass-panel,
.note-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.glass-header {
    text-align: center;
    padding: 3rem 2rem;
}

.glass-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #e879f9, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.glass-header p {
    font-size: 1.2rem;
    color: #cbd5e1;
}

/* Forms */
.add-note-section h2 {
    margin-bottom: 1.5rem;
    font-weight: 600;
}

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

input,
textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-family: 'Outfit', sans-serif;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
}

/* Notes */
.notes-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.note-card {
    padding: 1.5rem;
    transition: transform 0.3s ease, background 0.3s ease;
    animation: slideUp 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.note-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
}

.note-card h3 {
    margin-bottom: 0.5rem;
    color: #f8fafc;
    font-size: 1.5rem;
}

.note-card p {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.note-date {
    font-size: 0.8rem;
    color: #94a3b8;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Speedometer Styles */
.edit-modal-panel {
}

.speedometer-container {
    padding: 1rem 0;
}

.speedometer-gauge {
    position: relative;
    width: 240px;
    height: 120px;
    background: conic-gradient(from 270deg at 50% 100%,
            #0ea5e9 0deg,
            #0ea5e9 30deg,
            #94a3b8 90deg,
            #ec4899 150deg,
            #ec4899 180deg);
    border-top-left-radius: 120px;
    border-top-right-radius: 120px;
    margin: 0 auto 1.5rem;
    overflow: hidden;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.5);
}

.speedometer-inner {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 80px;
    background: rgba(15, 23, 42, 1);
    border-top-left-radius: 80px;
    border-top-right-radius: 80px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
}

.speedometer-needle {
    position: absolute;
    bottom: -10px;
    left: 50%;
    width: 6px;
    height: 100px;
    background: #fdf4ff;
    transform-origin: bottom center;
    border-radius: 4px;
    transition: transform 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.speedometer-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-weight: bold;
}

.score-p1 {
    color: #0ea5e9;
    text-align: left;
}

.score-p2 {
    color: #ec4899;
    text-align: right;
}


/* Responsive Design */
.leaderboards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

@media (max-width: 450px) {
    .app-container {
        padding: 1rem;
        gap: 1rem;
    }

    .glass-header {
        padding: 2rem 1rem;
    }

    .glass-header h1 {
        font-size: 2.2rem;
    }

    .glass-panel,
    .note-card {
        padding: 1.2rem;
    }

    .leaderboards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }



    .speedometer-container {
        transform: scale(0.95);
        transform-origin: center top;
    }
}

@media (max-width: 350px) {
    .speedometer-container {
        transform: scale(0.8);
    }

    .glass-header h1 {
        font-size: 1.8rem;
    }
}

/* FAB Button */
.fab-add {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #581c87, #7e22ce);
    color: white;
    font-size: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 25px rgba(88, 28, 135, 0.6);
    border: none;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab-add:hover {
    transform: scale(1.1) rotate(90deg);
}

/* Custom Select */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-wrapper::after {
    content: '▼';
    position: absolute;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
    color: #e879f9;
    pointer-events: none;
    font-size: 0.8rem;
}

select.custom-select {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

select.custom-select:focus {
    outline: none;
    border-color: #e879f9;
    box-shadow: 0 0 10px rgba(232, 121, 249, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

select.custom-select option {
    background: #1e293b;
    color: white;
}

/* Mac Modal Animation */
.mac-modal-overlay {
    display: none;
    position: fixed;
    top: -5%; left: -5%; width: 110%; height: 110%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mac-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.mac-modal-content {
    transform: scale(0) translate(200px, 200px);
    transform-origin: bottom right;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1), opacity 0.4s ease;
    opacity: 0;
    width: 90%;
    max-width: 500px;
}

.mac-modal-overlay.active .mac-modal-content {
    transform: scale(1) translate(0, 0);
    opacity: 1;
}