/* Hem & Trädgård - Mobile-first CSS */

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

:root {
    --primary: #2e7d32;
    --primary-light: #60ad5e;
    --primary-dark: #005005;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #e0e0e0;
    --danger: #d32f2f;
    --warning: #f57c00;
    --priority-high: #d32f2f;
    --priority-normal: #1976d2;
    --priority-low: #757575;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    padding-bottom: 80px;
}

/* Header & Navigation */
header {
    background: var(--primary);
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

nav {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
}

nav a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.875rem;
}

nav a:hover, nav a.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* Main Content */
main {
    padding: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text);
}

h3 {
    font-size: 1rem;
    margin: 1rem 0 0.5rem;
    color: var(--text-light);
}

/* Task List */
.task-list {
    list-style: none;
}

.task-item {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 4px solid var(--priority-normal);
}

.task-item.priority-3 { border-left-color: var(--priority-high); }
.task-item.priority-1 { border-left-color: var(--priority-low); }

.task-item.overdue { background: #fff3e0; }
.task-item.done { opacity: 0.6; }

.task-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.inline-form {
    display: inline;
}

.check-btn {
    width: 28px;
    height: 28px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    background: transparent;
    color: var(--primary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.task-info {
    flex: 1;
    min-width: 0;
}

.task-title {
    display: block;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    word-break: break-word;
}

.task-title:hover {
    color: var(--primary);
}

.tag {
    display: inline-block;
    background: #e8f5e9;
    color: var(--primary-dark);
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    margin-top: 0.25rem;
}

.time {
    display: inline-block;
    color: var(--text-light);
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.overdue-date {
    display: inline-block;
    color: var(--danger);
    font-size: 0.875rem;
    font-weight: 500;
}

.reminder-badge {
    display: inline-block;
    background: #fff3e0;
    color: var(--warning);
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    margin-left: 0.5rem;
}

.task-notes {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding-left: 2.5rem;
}

.done-list .task-title {
    text-decoration: line-through;
    color: var(--text-light);
}

.empty-message {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

/* Day sections */
.day-section {
    margin-bottom: 1.5rem;
}

.day-header {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.day-header.today {
    color: var(--primary);
}

.today-badge {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

/* Calendar */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.calendar-header h2 {
    margin: 0;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--card-bg);
    border-radius: 50%;
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.calendar {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.calendar th {
    background: var(--primary);
    color: white;
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.calendar td {
    border: 1px solid var(--border);
    padding: 0.25rem;
    vertical-align: top;
    height: 60px;
    width: 14.28%;
}

.calendar td.other-month {
    background: #fafafa;
    color: var(--text-light);
}

.calendar td.today {
    background: #e8f5e9;
}

.day-number {
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.day-tasks {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cal-task {
    display: block;
    font-size: 0.625rem;
    padding: 1px 3px;
    border-radius: 2px;
    background: #e3f2fd;
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal-task.done {
    text-decoration: line-through;
    opacity: 0.6;
}

.cal-task.priority-3 { background: #ffebee; }
.cal-task.priority-1 { background: #f5f5f5; }

.more-tasks {
    font-size: 0.625rem;
    color: var(--text-light);
}

/* Forms */
.task-form {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
}

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

.form-row .form-group {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
    background: var(--border);
    color: var(--text);
}

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

.btn.danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.delete-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* FAB - Floating Action Button */
.fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 100;
}

.fab:hover {
    background: var(--primary-dark);
}

/* Responsive - larger screens */
@media (min-width: 768px) {
    header {
        padding: 1rem 2rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    nav a {
        padding: 0.5rem 1rem;
    }

    main {
        padding: 1.5rem;
    }

    .calendar td {
        height: 100px;
        padding: 0.5rem;
    }

    .cal-task {
        font-size: 0.75rem;
        padding: 2px 4px;
    }
}
