:root {
    --bg: #f4f5f3;
    --card-bg: #ffffff;
    --text: #23241f;
    --text-muted: #6b6b63;
    --border: #e2e2dc;
    --accent: #3c5a45;
    --accent-hover: #2c4433;
    --danger: #a3372c;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.dashboard {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.dashboard-header h1 {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
}

.header-greeting {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.birthday-banner {
    background: linear-gradient(90deg, #f4d35e, #ee964b);
    color: #2b2110;
    border-radius: var(--radius);
    padding: 12px 18px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
}

.widget-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

.widget-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width: 640px) {
    .widget-grid {
        grid-template-columns: 1fr;
    }
}

.widget {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.widget-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.widget-header-row h2 { margin: 0; }

.widget h2 {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 600;
}

.widget-sub {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0 0 14px;
}

.today-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.today-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.today-label {
    font-size: 12px;
    color: var(--text-muted);
}

.today-value {
    font-size: 15px;
    font-weight: 500;
}

.today-item-weather {
    min-width: 0;
}

.today-value-weather {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.today-value-weather .weather-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

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

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

.btn-icon {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50;
}
.modal-overlay.hidden { display: none; }

.modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.modal-header h3 { margin: 0; font-size: 17px; }

#note-form textarea {
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    resize: vertical;
}

.note-form-actions {
    display: flex;
    gap: 8px;
    margin: 10px 0 18px;
}

.notes-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
    border-top: 1px solid var(--border);
}

.notes-empty {
    color: var(--text-muted);
    font-size: 13px;
    padding: 14px 0;
}

.note-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.note-item-text {
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-word;
}

.note-item-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.note-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.note-item-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: underline;
    padding: 0;
}
.note-item-actions button:hover { color: var(--text); }

.hidden { display: none !important; }

/* Teendők widget - mai lista a kártyán */
.tasks-today-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tasks-today-list li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.tasks-today-list li:last-child { border-bottom: none; }

.tasks-today-list .task-recurrence-tag {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg);
    border-radius: 6px;
    padding: 1px 6px;
    flex-shrink: 0;
}

.tasks-empty {
    color: var(--text-muted);
    font-size: 13px;
    padding: 4px 0;
}

/* Teendők szerkesztő form a modalban */
#task-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

#task-form input[type="text"],
#task-form input[type="date"],
#task-form input[type="number"],
#task-form select {
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
}

.task-form-row {
    display: flex;
    gap: 8px;
}
.task-form-row > * { flex: 1; }

.task-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.tasks-manage-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
    border-top: 1px solid var(--border);
}

.task-manage-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.task-manage-item-title {
    font-size: 14px;
    font-weight: 500;
}

.task-manage-item-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

.task-manage-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.task-manage-item-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: underline;
    padding: 0;
}
.task-manage-item-actions button:hover { color: var(--text); }

/* Rádió vezérlő */
.radio-player {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 12px 6px 6px;
}

.radio-toggle-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}
.radio-toggle-btn:hover { background: var(--accent-hover); }

.radio-label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.radio-volume {
    width: 70px;
}

.radio-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
}

.radio-visualizer span {
    width: 3px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
    animation: radio-bar 0.8s ease-in-out infinite;
    animation-play-state: paused;
}
.radio-visualizer span:nth-child(1) { animation-delay: 0s; }
.radio-visualizer span:nth-child(2) { animation-delay: 0.15s; }
.radio-visualizer span:nth-child(3) { animation-delay: 0.3s; }
.radio-visualizer span:nth-child(4) { animation-delay: 0.1s; }
.radio-visualizer span:nth-child(5) { animation-delay: 0.25s; }

.radio-visualizer.playing span {
    animation-play-state: running;
}

@keyframes radio-bar {
    0%, 100% { height: 4px; }
    50% { height: 16px; }
}

/* Időjárás ikonok */
.weather-icon .sun-body {
    fill: #f4b942;
}
.weather-icon .sun-rays {
    stroke: #f4b942;
    stroke-width: 3;
    stroke-linecap: round;
    transform-origin: center;
    animation: weather-spin 12s linear infinite;
}
.weather-icon .sun-rays-small {
    animation-duration: 10s;
}
@keyframes weather-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.weather-icon .cloud-body {
    fill: #cfd6dd;
}
.weather-icon .cloud-body-light {
    fill: #dfe4e8;
}
.weather-icon .cloud-body-dark {
    fill: #8992a0;
}
.weather-icon .cloud-float {
    animation: weather-float 4s ease-in-out infinite;
    transform-origin: center;
}
@keyframes weather-float {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(2px); }
}

.weather-icon .fog-lines line {
    stroke: #b9c0c7;
    stroke-width: 3;
    stroke-linecap: round;
    animation: weather-fog-slide 3s ease-in-out infinite;
}
.weather-icon .fog-lines line:nth-child(2) { animation-delay: 0.4s; }
.weather-icon .fog-lines line:nth-child(3) { animation-delay: 0.8s; }
@keyframes weather-fog-slide {
    0%, 100% { transform: translateX(-2px); opacity: 0.7; }
    50% { transform: translateX(2px); opacity: 1; }
}

.weather-icon .rain-drops line {
    stroke: #4f86c6;
    stroke-width: 3;
    stroke-linecap: round;
    animation: weather-rain-fall 0.7s linear infinite;
}
.weather-icon .rain-drops line:nth-child(2) { animation-delay: 0.2s; }
.weather-icon .rain-drops line:nth-child(3) { animation-delay: 0.4s; }
@keyframes weather-rain-fall {
    0% { transform: translateY(-3px); opacity: 0.3; }
    50% { opacity: 1; }
    100% { transform: translateY(3px); opacity: 0.3; }
}

.weather-icon .snow-flakes circle {
    fill: #bcd6ea;
    animation: weather-snow-fall 2.2s ease-in-out infinite;
}
.weather-icon .snow-flakes circle:nth-child(2) { animation-delay: 0.4s; }
.weather-icon .snow-flakes circle:nth-child(3) { animation-delay: 0.8s; }
.weather-icon .snow-flakes circle:nth-child(4) { animation-delay: 1.2s; }
.weather-icon .snow-flakes circle:nth-child(5) { animation-delay: 1.6s; }
@keyframes weather-snow-fall {
    0% { transform: translateY(-2px); opacity: 0.4; }
    50% { transform: translateY(3px); opacity: 1; }
    100% { transform: translateY(-2px); opacity: 0.4; }
}

.weather-icon .lightning-bolt {
    fill: #f4d35e;
    animation: weather-flash 1.6s ease-in-out infinite;
}
@keyframes weather-flash {
    0%, 100% { opacity: 0.3; }
    10%, 20% { opacity: 1; }
    30% { opacity: 0.3; }
}

/* Telex hírfolyam */
.telex-badge {
    display: inline-block;
    background: #113355;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
}

.telex-feed-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.telex-feed-item {
    border-left: 3px solid #113355;
    padding: 8px 0 8px 10px;
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.telex-feed-item a {
    color: var(--text);
    text-decoration: none;
}
.telex-feed-item a:hover {
    color: #113355;
    text-decoration: underline;
}

.telex-more-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #113355;
    text-decoration: none;
}
.telex-more-link:hover {
    text-decoration: underline;
}

/* Gmail widget */
.gmail-badge {
    display: inline-block;
    background: #c5221f;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
}

.gmail-disconnect-link {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: underline;
}

.gmail-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gmail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.gmail-item:last-child { border-bottom: none; }

.gmail-item-from {
    font-size: 13px;
    font-weight: 600;
}

.gmail-item-subject {
    font-size: 14px;
    margin-top: 1px;
}

.gmail-item-snippet {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 320px;
}

.gmail-reply-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.gmail-reply-to-label {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 8px;
}

#gmail-reply-body {
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    resize: vertical;
    margin-bottom: 10px;
}

.gmail-reply-status {
    font-size: 13px;
    color: var(--text-muted);
    margin: 8px 0 0;
}

/* Login */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-form {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-form h1 {
    font-size: 18px;
    margin: 0 0 10px;
    text-align: center;
}

.login-form input {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}

.login-error {
    color: var(--danger);
    font-size: 13px;
    margin: 0;
}
