:root {
    /* Color Palette - High Contrast Minimalist / Dark Mode */
    --bg-main: #121212;
    --bg-card: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #ffb703; /* Bright visible yellow/orange for high contrast against dark */
    --accent-hover: #ff9100;
    --border: #333333;
    --error: #ef233c;
    --success: #2a9d8f;

    /* Typography */
    --font-family: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    /* Prevent pull-to-refresh on mobile */
    overscroll-behavior-y: contain; 
}

/* Base App Layout */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Views toggling */
.view {
    display: none;
    flex-direction: column;
    flex: 1;
    padding: 1.5rem;
}
.view.active {
    display: flex;
}

/* Typography styles */
h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.05em; margin: 0;}
h2 { font-size: 1.5rem; font-weight: 600; margin: 0;}

/* Buttons */
button {
    font-family: inherit;
    border: none;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--accent);
    color: #000;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 183, 3, 0.3);
}
.btn-primary:active { transform: scale(0.95); }

.btn-primary-solid {
    background: var(--accent);
    color: #000;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    width: 100%;
}

.btn-icon {
    background: transparent;
    color: var(--text-primary);
    padding: 0.5rem;
    display: flex;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
}
.btn-secondary:active { background: var(--border); }

.btn-text {
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 1rem;
}

/* --- LOGIN VIEW --- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.login-box {
    background: var(--bg-card);
    width: 100%;
    max-width: 400px;
    padding: 2.5rem 2rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    text-align: center;
}
.login-box h1 { margin-bottom: 0.5rem; }
.login-box p { color: var(--text-secondary); margin-bottom: 2rem; font-size: 0.875rem; }
.login-box input { margin: 0 auto 1.5rem auto; width: 100%; max-width: 200px; display: block; text-align: center; font-size: 1.25rem; letter-spacing: 0.2rem; }
.login-error { color: var(--error); font-size: 0.875rem; margin-bottom: 1rem; }

/* --- DASHBOARD VIEW --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s;
}
.project-card:active {
    transform: scale(0.98);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}
.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
.card-progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.card-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
}
.card-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 4rem;
}
.empty-state p { margin-bottom: 0.5rem; }

/* --- COUNTER VIEW --- */
.counter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.counter-title-wrap {
    text-align: center;
    flex: 1;
}
.progress-text {
    font-size: 0.875rem;
    color: var(--accent);
    font-weight: 600;
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: var(--bg-card);
    margin: 1.5rem 0;
    border-radius: 2px;
}
.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
}

.row-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}
.row-label {
    font-size: 1.125rem;
    color: var(--text-secondary);
}
.row-target {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.main-counter-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-massive-counter {
    background: none;
    border: 4px solid var(--accent);
    color: var(--text-primary);
    border-radius: 50%;
    width: 80vw;
    height: 80vw;
    max-width: 350px;
    max-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(255, 183, 3, 0.1);
}
.btn-massive-counter:active {
    background: rgba(255, 183, 3, 0.1);
    transform: scale(0.95);
}

.counter-number {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.tap-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.counter-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
}

.status-indicators {
    display: flex;
    gap: 1rem;
}

.indicator {
    font-size: 1.2rem;
    position: relative;
    opacity: 0.5;
}
.indicator.active {
    opacity: 1;
}

.indicator-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.indicator-dot.red { background: var(--error); }
.indicator-dot.green { background: var(--success); }


/* --- MODALS --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1.5rem;
    backdrop-filter: blur(4px);
}
.modal-overlay.hidden {
    display: none;
}
.modal-content {
    background: var(--bg-main);
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}
.form-row {
    display: flex;
    gap: 1rem;
}
.half {
    flex: 1;
}

label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

input, textarea {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 1rem;
    font-size: 1rem;
    border-radius: 12px;
    font-family: inherit;
}
input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.completion-box {
    text-align: center;
    padding: 3rem 2rem;
}
.completion-box h2 {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 1rem;
}
.completion-box p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Utilities */
.hidden { display: none !important; }
