@view-transition {
    navigation: auto;
}

:root {
    --ui-bg: #f8f8f8;
    --ui-fg: #222222;
    --ui-accent: #f32748;
    --max-width: 1280px;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "TikTok Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--ui-fg);
    background-color: var(--ui-bg);
    overflow-x: hidden;
}
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Oxygen, Ubuntu, Cantarell, sans-serif;
}

a {
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 50%, transparent);
}

code {
    font-family: "JetBrains Mono", monospace;
}

.ui-accent {
    color: var(--ui-accent);
}

.ui--accent-block {
    background-color: #ffffff;
    color: #000000;
    padding: 0.5em 1em;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 48px;
    font-size: 13px;
    line-height: 1;
    margin: 0 auto 2em auto;
    width: fit-content;
}

.profile-link {
    color: var(--ui-accent);
    text-decoration: none;
}

.date-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2em;
    background-color: #ffffff;
    padding: 1em;
    margin: 0 0 2em 0;
}

.completedGoals,
.totalGoals {
    font-weight: 600;
}
.completion-message {
    margin-left: auto;
}

/* Authentication styles */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ui-accent) 0%, #764ba2 100%);
}

.auth-box {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-box h1 {
    margin-bottom: 2rem;
    color: var(--ui-fg);
    font-size: 1.8rem;
}

.auth-form h2 {
    margin-bottom: 1.5rem;
    color: var(--ui-fg);
    font-size: 1.5rem;
}

.auth-form .form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--ui-fg);
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--ui-accent);
}

.auth-form .form-actions {
    margin-top: 1.5rem;
}

.auth-form .btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.auth-switch {
    margin-top: 1rem;
    color: #666;
}

.auth-switch a {
    color: var(--ui-accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
}

.auth-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.auth-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.logout-link {
    color: #ff6b6b !important;
}

.logout-link:hover {
    background-color: rgba(255, 107, 107, 0.2) !important;
}

/* Welcome Message */
.welcome-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
    text-align: center;
}

.welcome-message.success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

/* User Info */
.user-info {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
    text-align: center;
}

.user-info h2 {
    color: var(--ui-fg);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.user-info p {
    color: #666;
    font-size: 1.1rem;
}

/* Account Settings Styles */
.account-settings {
    display: grid;
    grid-gap: 1em;
    grid-template-columns: repeat(2, 1fr);
}

.setting-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.setting-section h3 {
    margin-bottom: 1rem;
    color: var(--ui-fg);
    font-size: 1.3rem;
}

.setting-section p {
    color: #666;
    margin-bottom: 1.5rem;
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.setting-label {
    font-weight: 500;
    color: var(--ui-fg);
}

.setting-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.setting-info code {
    background: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: "JetBrains Mono", monospace;
    color: #495057;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--ui-accent);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Public Profile Styles */
.public-profile-header {
    text-align: center;
    margin-bottom: 2rem;
}

.public-profile-header h2 {
    color: var(--ui-fg);
    margin-bottom: 0.5rem;
}

.public-profile-header p {
    color: #666;
    font-style: italic;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
header {
    background: white;
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #e1e5e9;
}

header h1 {
    color: var(--ui-fg);
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 700;
}

.alignfull {
    margin-left: calc(-100vw / 2 + 100% / 2);
    margin-right: calc(-100vw / 2 + 100% / 2);
    max-width: 100vw;
    width: auto !important;
}

/*
nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

nav a {
    color: var(--ui-fg);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}
/**/

nav a:hover,
nav a.active {
    color: var(--ui-accent);
}

/* Date selector */
.date-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.date-btn {
    background: var(--ui-accent);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.date-btn:hover {
    background-color: #8b6b42;
}

#currentDate {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--ui-fg);
    min-width: 200px;
    text-align: center;
}

/* Summary card */
.summary-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.summary-card h2 {
    margin-bottom: 1.5rem;
    color: var(--ui-fg);
    font-size: 1.5rem;
}

.completion-summary {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.completion-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(#4caf50 0deg, #4caf50 0deg, #e0e0e0 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.completion-circle::before {
    content: "";
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: white;
    position: absolute;
}

#completionPercentage {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ui-fg);
    z-index: 1;
}

.completion-stats {
    display: flex;
    gap: 2rem;
}

.completion-stats p {
    text-align: center;
}

#completionMessage {
    color: var(--ui-fg);
    font-size: 1.1rem;
    margin: 0;
}

/* Goals grid */
.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.goal-card {
    display: flex;
    flex-direction: column;

    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.025), 0 2px 4px rgba(0, 0, 0, 0.025),
        0 4px 8px rgba(0, 0, 0, 0.025), 0 8px 16px rgba(0, 0, 0, 0.025);
    border: 1px solid #e1e5e9;
    transition: transform 0.3s ease;
}

.goal-card:hover {
    transform: translateY(-5px);
}

/* Incomplete state (default white) */
.goal-card.incomplete {
    border-left: 4px solid #ff9800;
}

/* Completed state (100%) */
.goal-card.completed {
    border-left: 4px solid #4caf50;
}

/* Over-completed state (>100%) */
.goal-card.overcompleted {
    border-left: 4px solid #2196f3;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.goal-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.status-badge {
    font-size: 1.2rem;
}

.overcompleted-badge {
    animation: pulse 2s infinite;
}

.completed-badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.goal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--ui-fg);
    margin-bottom: 0.5rem;
}

.goal-category {
    background: var(--ui-accent);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;

    background-color: oklch(0.971 0.013 17.38);
    border: 1px solid;
    border-color: #e400141a;
    color: oklch(0.505 0.213 27.518);
}

.goal-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.goal-progress {
    margin-top: auto;
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

/* Progress bar colors for different states */
.progress-fill.incomplete {
    background: #ff9800;
}

.progress-fill.completed {
    background: #4caf50;
}

.progress-fill.overcompleted {
    background: #2196f3;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #666;
}

.goal-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.control-btn {
    font-family: "JetBrains Mono";
    background: var(--ui-accent);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.control-btn:hover {
    background-color: #8b6b42;
}

.control-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.goal-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ui-fg);
    text-align: center;
}

.goal-target {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

/* Buttons */
.btn {
    background: var(--ui-accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--ui-accent);
}

.btn-primary:hover {
    background-color: #8b6b42;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-google {
    background: #fff;
    color: #444;
    border: 1px solid #ccc;
    padding: 0.5em 1em;
    border-radius: 4px;
    display: inline-block;
    text-decoration: none;
    font-weight: 500;
}
.btn-google:hover {
    background: #f7f7f7;
}

.add-goal-section {
    margin-bottom: 2rem;
    text-align: center;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: modalSlideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--ui-fg);
}

.modal h2 {
    margin-bottom: 1.5rem;
    color: var(--ui-fg);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--ui-fg);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--ui-accent);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Profile page styles */
.profile-header {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--ui-fg);
}

.profile-header p {
    color: #666;
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--ui-accent);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.2rem;
    color: #666;
    font-weight: 500;
}

.stat-card p {
    color: #666;
    font-weight: 500;
}

/* Badges Section */
.badges-section {
    margin-bottom: 2rem;
}

.badges-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--ui-fg);
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.badge-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
}

.badge-card.earned {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #f8fff8 0%, #ffffff 100%);
}

.badge-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.badge-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-card.earned .badge-icon {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    animation: badgeGlow 2s ease-in-out infinite alternate;
}

@keyframes badgeGlow {
    from {
        box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
    }
    to {
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
    }
}

.badge-info {
    flex: 1;
}

.badge-info h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--ui-fg);
    margin-bottom: 0.5rem;
}

.badge-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.badge-date {
    font-size: 0.8rem;
    color: #4CAF50;
    font-weight: 500;
}

.no-badges {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #ddd;
}

/* Badge Notification */
.badge-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

.badge-notification-content {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 2px solid #4CAF50;
    max-width: 300px;
    position: relative;
}

.badge-notification h4 {
    color: var(--ui-fg);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.new-badges-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.new-badge-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8fff8;
    border-radius: 8px;
    border: 1px solid #4CAF50;
}

.new-badge-item .badge-icon {
    font-size: 1.2rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #4CAF50;
    color: white;
    border-radius: 50%;
}

.close-notification {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.close-notification:hover {
    background-color: #f0f0f0;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.heatmap-section {
    margin: 2rem 0;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
    overflow: hidden;
}

.heatmap-section h3 {
    margin-bottom: 1.5rem;
    color: var(--ui-fg);
    font-size: 1.5rem;
    font-weight: 600;
}

.heatmap-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    overflow: hidden;
}

.heatmap-summary {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ui-accent);
}

.stat-label {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

.legend-squares {
    display: flex;
    gap: 2px;
}

.legend-square {
    width: 14px;
    height: 14px;
    border-radius: 2px;
}

.legend-square.level-0 { background-color: #ebedf0; }
.legend-square.level-1 { background-color: #9be9a8; }
.legend-square.level-2 { background-color: #40c463; }
.legend-square.level-3 { background-color: #30a14e; }
.legend-square.level-4 { background-color: #216e39; }

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(53, 1fr);
    gap: 2px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.heatmap-week {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.heatmap-day {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
}

.heatmap-day:hover {
    transform: scale(1.2);
    z-index: 10;
}

.heatmap-day.level-0 { background-color: #ebedf0; }
.heatmap-day.level-1 { background-color: #9be9a8; }
.heatmap-day.level-2 { background-color: #40c463; }
.heatmap-day.level-3 { background-color: #30a14e; }
.heatmap-day.level-4 { background-color: #216e39; }

.heatmap-tooltip {
    position: fixed;
    background: #333;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.chart-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chart-container h3 {
    margin-bottom: 1.5rem;
    color: var(--ui-fg);
    text-align: center;
    flex-shrink: 0;
}

.chart-container canvas {
    flex: 1;
    max-height: 300px;
}

.activity-list {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #e1e5e9;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-date {
    font-weight: 600;
    color: var(--ui-fg);
}

.activity-text {
    color: #666;
    flex: 1;
    margin-left: 1rem;
}

/* Settings page styles */
.settings-header {
    text-align: center;
    margin-bottom: 2rem;
}

.settings-header h2 {
    color: var(--ui-fg);
    margin-bottom: 0.5rem;
}

.settings-header p {
    color: #666;
}

.settings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e1e5e9;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    color: #666;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.tab-btn.active,
.tab-btn:hover {
    color: var(--ui-accent);
    border-bottom-color: var(--ui-accent);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h3 {
    color: var(--ui-fg);
}

.goals-list,
.items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.goal-item,
.category-item,
.type-item {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-info h4 {
    color: var(--ui-fg);
    margin-bottom: 0.25rem;
}

.item-info p {
    color: #666;
    font-size: 0.9rem;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.item-actions button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.item-actions .btn-edit {
    background: var(--ui-accent);
    color: white;
}

.item-actions .btn-edit:hover {
    background-color: #8b6b42;
}

.item-actions .btn-delete {
    background: #dc3545;
    color: white;
}

.item-actions .btn-delete:hover {
    background-color: #c82333;
}

/* Responsive design */
@media (max-width: 1024px) {
    .goals-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .badges-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    .heatmap-grid {
        max-width: 600px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    nav {
        flex-wrap: wrap;
    }

    .completion-summary {
        flex-direction: column;
        text-align: center;
    }

    .goals-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .badges-grid {
        grid-template-columns: 1fr;
    }

    .badge-card {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .badge-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 300px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .settings-tabs {
        flex-wrap: wrap;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .goal-item,
    .category-item,
    .type-item {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .item-actions {
        justify-content: center;
    }

    .heatmap-section {
        padding: 1rem;
    }

    .heatmap-grid {
        grid-template-columns: repeat(26, 1fr);
        gap: 1px;
        max-width: 400px;
    }

    .heatmap-day {
        width: 12px;
        height: 12px;
    }

    .legend-square {
        width: 12px;
        height: 12px;
    }

    .heatmap-summary {
        gap: 1rem;
    }

    .stat-number {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        padding: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .goal-controls {
        flex-direction: column;
        gap: 0.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .badges-grid {
        grid-template-columns: 1fr;
    }

    .badge-card {
        padding: 1rem;
    }

    .badge-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .chart-container {
        height: 250px;
    }

    .heatmap-grid {
        grid-template-columns: repeat(13, 1fr);
        gap: 1px;
        max-width: 200px;
    }

    .heatmap-day {
        width: 10px;
        height: 10px;
    }

    .legend-square {
        width: 10px;
        height: 10px;
    }

    .heatmap-summary {
        flex-direction: column;
        gap: 0.5rem;
    }

    .stat-number {
        font-size: 1rem;
    }
}

/* Leaderboard Styles */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.leaderboard-table th,
.leaderboard-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e1e5e9;
    text-align: left;
}
.leaderboard-table th {
    background: #f7f7fa;
    font-weight: 600;
    color: var(--ui-fg);
}
.leaderboard-table tr.highlight {
    background: #e3f7e3;
    font-weight: bold;
}
.dots-row td {
    text-align: center;
    color: #aaa;
    font-size: 1.2em;
    background: transparent;
    border: none;
}


.a12y-premium-upgrade-notice {
    background-color: #faf5ff;
    color: #8200db;
    border: 1px solid rgb(130, 0, 219);
    border-radius: .375em;
    padding: 0.334em 0.667em;
}
.a12y-premium-upgrade-notice a {
    font-weight: 600;
}
