:root {
    /* Color Palette */
    --bg-color: #ffffff;
    --text-primary: #111827;
    /* Dark Gray for headings/important text */
    --text-secondary: #4b5563;
    /* Medium Gray for body text */
    --text-tertiary: #9ca3af;
    /* Light Gray for placeholders/labels */
    --border-color: #e5e7eb;
    --accent-color: #111827;
    /* Deep Blue/Black for primary actions */
    --accent-hover: #000000;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --table-header-bg: #f9fafb;
    --project-col-bg: #f3f4f6;
}

html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-secondary);
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: fixed;
    /* Prevent rubber-band on Safari */
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 0;
}

/* Minimalist Card */
.glass-card {
    background: var(--bg-color);
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 0.875rem;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

input[type="text"],
input[type="email"],
input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

input:focus {
    outline: none;
    border-color: var(--accent-color);
}

input::placeholder {
    color: var(--text-tertiary);
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.025em;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-logout {
    color: var(--danger-color) !important;
    font-weight: 600 !important;
}

.nav-logout:hover {
    opacity: 0.8;
}

/* Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th,
td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

th {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: var(--table-header-bg);
}

td {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 60vh;
    width: 100%;
}

.chart-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chart-btn {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.chart-btn:hover {
    border-color: var(--text-tertiary);
    color: var(--text-primary);
}

.chart-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Reduce padding for New Project Modal */
#projectModal .modal-content {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transform: translateY(1rem);
    transition: all 0.3s ease;
    z-index: 2000;
    font-size: 0.875rem;
    font-weight: 500;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--danger-color);
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

/* Streak Badge */
.streak-badge {
    display: inline-block;
    padding: 0.08rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--border-color);
    white-space: nowrap;
}

.streak-active {
    background-color: #fef3c7;
    color: #d97706;
    border: 1px solid #fcd34d;
    gap: 0.25rem;
    animation: pulse-orange 2s infinite;
}

@keyframes pulse-orange {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    nav {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .chart-header {
        justify-content: center;
        margin-bottom: 0.5rem;
    }

    .chart-controls {
        justify-content: center;
        gap: 0.25rem;
    }

    .chart-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .chart-container {
        height: 50vh;
    }

    .mobile-hidden {
        display: none;
    }

    .mobile-input-section {
        display: block;
    }

    table {
        min-width: auto;
    }

    .history-content {
        padding: 1rem !important;
    }

    /* Fix Modal Width on Mobile */
    .modal-content {
        width: 90%;
        height: 80%;
        max-width: none;
        display: flex;
        flex-direction: column;
        padding: 1.5rem;
        box-sizing: border-box;
        margin: 0 auto;
    }

    .modal-body {
        flex: 1;
        overflow: hidden;
        /* Prevent body scroll */
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .history-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        min-height: 0;
        margin-top: 1rem;
    }

    .history-scroll-area {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .history-table thead {
        position: sticky;
        top: 0;
        background: var(--bg-color);
        z-index: 1;
    }

    /* Prevent zoom on modal input */
    #newProjectName,
    #modalContentInput {
        font-size: 16px !important;
    }
}

/* Drum Picker Styles */
.drum-picker-container {
    position: relative;
    height: 90px;
    /* Expanded height for visibility */
    width: 60px;
    /* Compact width */
    overflow: hidden;
    background: #ffffff;
    border-radius: 8px;
    flex-shrink: 0;
    /* Prevent shrinking in flex container */
}

.drum-picker-highlight {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 30px;
    margin-top: -15px;
    background: rgba(181, 181, 181, 0.11);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.drum-picker-scroll {
    height: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    touch-action: pan-y;
    scroll-snap-type: y mandatory;
    box-sizing: border-box;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.drum-picker-scroll::-webkit-scrollbar {
    display: none;
}

.drum-item {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    scroll-snap-align: center;
    transition: all 0.2s;
    opacity: 0.5;
}

.drum-item:first-child {
    margin-top: 30px;
}

.drum-item:last-child {
    margin-bottom: 30px;
}

.drum-item.selected {
    color: var(--accent-color);
    opacity: 1;
    transform: scale(1.1);
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 1rem;
}

.login-card {
    text-align: center;
    padding: 3rem 2rem;
    max-width: 400px;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.login-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
}

.login-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
nav {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
}

.chart-header {
    justify-content: center;
    margin-bottom: 0.5rem;
}

.chart-controls {
    justify-content: center;
    gap: 0.25rem;
}

.chart-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
}

h2 {
    font-size: 1.25rem;
}

.chart-container {
    height: 50vh;
}

.mobile-hidden {
    display: none;
}

.mobile-input-section {
    display: block;
}

table {
    min-width: auto;
}

.history-content {
    padding: 1rem !important;
}

/* Fix Modal Width on Mobile */
.modal-content {
    width: 90%;
    height: 80%;
    max-width: none;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    box-sizing: border-box;
    margin: 0 auto;
}

.modal-body {
    flex: 1;
    overflow: hidden;
    /* Prevent body scroll */
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.history-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    margin-top: 1rem;
}

.history-scroll-area {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.history-table thead {
    position: sticky;
    top: 0;
    background: var(--bg-color);
    z-index: 1;
}

/* Prevent zoom on modal input */
#newProjectName,
#modalContentInput {
    font-size: 16px !important;
}
}

/* Drum Picker Styles */
.drum-picker-container {
    position: relative;
    height: 90px;
    /* Expanded height for visibility */
    width: 60px;
    /* Compact width */
    overflow: hidden;
    background: #ffffff;
    border-radius: 8px;
    flex-shrink: 0;
    /* Prevent shrinking in flex container */
}

.drum-picker-highlight {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 30px;
    margin-top: -15px;
    background: rgba(181, 181, 181, 0.11);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.drum-picker-scroll {
    height: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    touch-action: pan-y;
    scroll-snap-type: y mandatory;
    box-sizing: border-box;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.drum-picker-scroll::-webkit-scrollbar {
    display: none;
}

.drum-item {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    scroll-snap-align: center;
    transition: all 0.2s;
    opacity: 0.5;
}

.drum-item:first-child {
    margin-top: 30px;
}

.drum-item:last-child {
    margin-bottom: 30px;
}

.drum-item.selected {
    color: var(--accent-color);
    opacity: 1;
    transform: scale(1.1);
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 1rem;
}

.login-card {
    text-align: center;
    padding: 3rem 2rem;
    max-width: 400px;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.login-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
}

.login-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.google-btn-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

.streak-inactive {
    background-color: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}