:root {
    --primary: #FF6B6B;
    --success: #51CF66;
    --danger: #FF6B6B;
    --warning: #FFD93D;
    --secondary: #495057;
    --background: #F8F9FA;
    --card: #FFFFFF;
    --text: #212529;
    --text-light: #6C757D;
    --border: #DEE2E6;

    /* Event colors */
    --solo-drink: #51CF66;    /* Green for Dylan drinks */
    --strong-zero: #FFD93D;   /* Yellow for Strong Zero */
    --group-round: #4DABF7;   /* Blue for Group drinks */
    --missed-round: #FF6B6B;  /* Red for Missed round */
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

/* Event buttons */
.btn-event {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px;
    text-align: left;
    font-weight: 600;
}

.btn-icon {
    font-size: 2rem;
    line-height: 1;
}

.btn-title {
    font-size: 1rem;
    font-weight: 700;
}

.btn-desc {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 400;
}

.btn-solo {
    background: var(--solo-drink);
    color: white;
}

.btn-group {
    background: var(--group-round);
    color: white;
}

.btn-missed {
    background: var(--missed-round);
    color: white;
}

.btn-correction {
    background: var(--strong-zero);
    color: #2D3748;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-box {
    text-align: center;
    padding: 20px;
    background: var(--background);
    border-radius: 8px;
}

.stat-box.highlight {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
}

.stat-box.status {
    background: var(--success);
    color: white;
}

.stat-box.status.behind {
    background: var(--danger);
    color: white;
}

.stat-box.status.done {
    background: var(--warning);
    color: var(--text);
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-formula {
    font-size: 0.8rem;
    margin-top: 4px;
    opacity: 0.9;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
}

/* Chart section */
.chart-section {
    margin-bottom: 20px;
}

.chart-container {
    position: relative;
    height: 350px;
    background: var(--card);
    border-radius: 8px;
    padding: 20px;
}

.history-list {
    background: var(--card);
    border-radius: 8px;
    padding: 16px;
    max-height: 500px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    border-left: 4px solid transparent;
    transition: all 0.2s;
}

.history-item:hover {
    background: var(--background);
}

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

.history-item.solo_drink {
    border-left-color: var(--solo-drink);
    background: linear-gradient(90deg, rgba(81, 207, 102, 0.05) 0%, transparent 100%);
}

.history-item.strong_zero {
    border-left-color: var(--strong-zero);
    background: linear-gradient(90deg, rgba(255, 217, 61, 0.08) 0%, transparent 100%);
}

.history-item.group_round {
    border-left-color: var(--group-round);
    background: linear-gradient(90deg, rgba(77, 171, 247, 0.08) 0%, transparent 100%);
}

.history-item.missed_round {
    border-left-color: var(--missed-round);
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.05) 0%, transparent 100%);
}

.history-action {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-icon {
    font-size: 1.2rem;
}

.history-action.solo_drink {
    color: var(--solo-drink);
}

.history-action.strong_zero {
    color: #D4A929;
}

.history-action.group_round {
    color: var(--group-round);
}

.history-action.missed_round {
    color: var(--missed-round);
}

.history-meta {
    color: var(--text-light);
    font-size: 0.9rem;
}

.history-user {
    font-weight: 600;
    margin-right: 8px;
}

.btn-delete {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
    margin-left: 8px;
    opacity: 0.6;
    transition: all 0.2s;
    border-radius: 4px;
}

.btn-delete:hover {
    opacity: 1;
    background: rgba(255, 107, 107, 0.1);
    transform: scale(1.1);
}

.btn-reset {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
    margin-left: 4px;
    opacity: 0.6;
    transition: all 0.2s;
    border-radius: 4px;
}

.btn-reset:hover {
    opacity: 1;
    background: rgba(170, 150, 218, 0.1);
    transform: scale(1.1);
}

.loading {
    text-align: center;
    color: var(--text-light);
    padding: 40px;
}

/* Notification button styles */
.notification-btn {
    position: fixed;
    z-index: 1000;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

/* Expanded state (initial prompt) */
.notification-btn-expanded {
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 50px;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.notification-btn-expanded:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.notification-btn-expanded .notification-btn-icon {
    font-size: 1.2rem;
}

.notification-btn-expanded .notification-btn-status {
    display: none;
}

/* Minimized state (after acceptance) */
.notification-btn-minimized {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: var(--card);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    justify-content: center;
}

.notification-btn-minimized:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.notification-btn-minimized .notification-btn-icon {
    font-size: 1.3rem;
}

.notification-btn-minimized .notification-btn-text {
    display: none;
}

.notification-btn-minimized .notification-btn-status {
    display: block;
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: var(--success);
    border: 2px solid var(--card);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Pulse animation for active notification indicator */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Tooltip for minimized button */
.notification-btn-minimized::after {
    content: 'Notifications on • Click to disable';
    position: absolute;
    top: -35px;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.notification-btn-minimized:hover::after {
    opacity: 1;
}

.notification-btn-minimized:active {
    transform: scale(0.95);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .stat-box {
        padding: 12px 8px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .stat-formula {
        font-size: 0.6rem;
    }

    #controls-section > div:first-child {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }

    .btn-event {
        padding: 8px 6px;
        gap: 6px;
        min-width: 0;
    }

    .btn-icon {
        font-size: 1.3rem;
    }

    .btn-title {
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .btn-desc {
        font-size: 0.6rem;
        white-space: nowrap;
    }

    .container {
        padding: 6px;
    }

    .btn {
        white-space: normal;
        min-width: 0;
    }

    .chart-container {
        height: 250px;
        padding: 12px;
    }

    .admin-header {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }

    #controls-section {
        margin-bottom: 12px;
    }

    #controls-section > div:last-child {
        flex-direction: column;
        gap: 8px;
    }

    #purge-btn {
        font-size: 0.85rem;
        padding: 10px;
    }

    #controls-section p {
        font-size: 0.75rem;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history-item {
    animation: slideIn 0.3s ease;
}
