:root {
    --bg-color: #fcfcfc;
    --surface-color: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --primary-color: #0f172a;
    --primary-hover: #334155;
    --danger-color: #ef4444;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    padding: 2rem 1rem;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

header {
    margin-bottom: 2.5rem;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

h2 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

input {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: var(--bg-color);
}

input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

.form-actions {
    margin-top: 2rem;
}

button {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    width: 100%;
}

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

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

.btn-secondary {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-color);
    border-color: #d1d5db;
}

.export-section {
    margin-bottom: 2rem;
}

.history-section {
    margin-top: 3rem;
}

.date-group {
    margin-bottom: 2rem;
}

.date-title {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.date-day {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 400;
}

.chunks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.chunk-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chunk-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: #d1d5db;
}

.chunk-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.chunk-bp {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.chunk-bp span {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.empty-state {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem 0;
    font-style: italic;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--surface-color);
    border-radius: var(--radius);
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal h3 {
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 1.125rem;
}

.reading-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.reading-time {
    color: var(--text-secondary);
}

.reading-val {
    font-weight: 500;
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
}
