:root {
    --bg-1: #070b17;
    --bg-2: #0d1528;
    --bg-3: #111c33;
    --panel: rgba(17, 26, 42, 0.68);
    --panel-strong: rgba(17, 24, 39, 0.86);
    --panel-soft: rgba(255, 255, 255, 0.06);
    --primary: #7c8cff;
    --primary-strong: #5c6bff;
    --primary-soft: rgba(124, 140, 255, 0.15);
    --text: #edf3ff;
    --muted: #a7b4d3;
    --border: rgba(166, 185, 255, 0.18);
    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.12);
    --danger: #ff7b7b;
    --danger-soft: rgba(255, 123, 123, 0.12);
    --shadow: 0 24px 80px rgba(4, 9, 19, 0.7);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(124, 140, 255, 0.28), transparent 22%),
        radial-gradient(circle at bottom right, rgba(52, 211, 153, 0.18), transparent 30%),
        linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 40%, var(--bg-3) 100%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

button,
input {
    font: inherit;
}

.app {
    width: min(900px, 100%);
    background: rgba(15, 21, 36, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 30px 28px 32px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: floatCard 6s ease-in-out infinite alternate;
}

.app::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, rgba(124, 140, 255, 0.14), transparent 35%, rgba(52, 211, 153, 0.1));
    pointer-events: none;
}

.header,
.task-input,
.filters,
.tasks-section {
    position: relative;
    z-index: 1;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

.header h1 {
    font-size: clamp(2.1rem, 4vw, 3.2rem);
    line-height: 1.05;
    letter-spacing: -0.06em;
    margin-bottom: 8px;
    font-weight: 800;
    color: white;
}

.header p {
    color: var(--muted);
    font-size: 1rem;
}

.voice-button {
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: white;
    padding: 15px 22px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(92, 107, 255, 0.42);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.voice-button::before {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    transform: scale(0.7);
    opacity: 0;
    animation: pulseRing 2.2s ease-out infinite;
}

.voice-button:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 18px 34px rgba(124, 140, 255, 0.52);
}

.task-input {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 12px 12px 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 20px 30px rgba(8, 12, 20, 0.28);
}

.task-input input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1.05rem;
    padding: 12px 8px;
    outline: none;
}

.task-input input::placeholder {
    color: rgba(167, 180, 211, 0.7);
}

.task-input button {
    border: none;
    background: linear-gradient(135deg, #1f2937 0%, #0d1322 100%);
    color: white;
    padding: 14px 22px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 16px 24px rgba(17, 24, 39, 0.36);
}

.task-input button:hover {
    transform: translateY(-1px);
    opacity: 0.98;
}

.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter {
    border: 1px solid transparent;
    background: rgba(124, 140, 255, 0.08);
    color: var(--muted);
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 999px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.filter:hover {
    background: rgba(124, 140, 255, 0.14);
    color: var(--text);
}

.filter.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: white;
    box-shadow: 0 12px 20px rgba(92, 107, 255, 0.28);
}

.tasks-section h2 {
    margin-bottom: 16px;
    font-size: 1.3rem;
    letter-spacing: -0.04em;
    color: white;
}

#taskList {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.task-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-group h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.task-group-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.84rem;
}

.task-meta .priority-high {
    color: #e99aa2;
}

.task-meta .priority-medium {
    color: #6ee7a0;
}

.task-meta .priority-low {
    color: #b5bbc4;
}

.task-group-urgent h3 {
    color: #ffb0b0;
}

.task {
    background: rgba(13, 19, 30, 0.82);
    border: 1px solid var(--border);
    padding: 18px 18px 16px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 20px 30px rgba(3, 6, 14, 0.28);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
    animation: taskIn 0.38s ease both;
}

.task:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 36px rgba(3, 6, 14, 0.34);
    border-color: rgba(124, 140, 255, 0.35);
}

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

.task-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    word-break: break-word;
}

.task-description {
    color: var(--muted);
    font-size: 0.93rem;
    line-height: 1.45;
    word-break: break-word;
}

.task.completed {
    background: rgba(92, 102, 120, 0.22);
    border-color: rgba(148, 163, 184, 0.28);
    opacity: 0.78;
}

.task.completed .task-title {
    text-decoration: line-through;
    color: #a7afbf;
}

.task.completed .task-meta,
.task.completed .task-description {
    color: #8993a6;
}

.task-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.task-actions button {
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 700;
}

.task-actions button:hover {
    background: rgba(124, 140, 255, 0.14);
    transform: translateY(-1px);
}

.task-actions button:last-child {
    background: rgba(255, 123, 123, 0.08);
    color: #ffb0b0;
}

.task-actions button:last-child:hover {
    background: rgba(255, 123, 123, 0.14);
}

@keyframes pulseRing {
    0% {
        transform: scale(0.7);
        opacity: 0.9;
    }
    70% {
        transform: scale(1.2);
        opacity: 0;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

@keyframes floatCard {
    0% {
        transform: translateY(0px);
    }
    100% {
        transform: translateY(-4px);
    }
}

@keyframes taskIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 640px) {
    .app {
        padding: 22px 18px 24px;
        border-radius: 22px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .task-input {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
    }

    .task-input button {
        width: 100%;
    }

    .task {
        flex-direction: column;
        align-items: flex-start;
    }

    .task-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (prefers-color-scheme: light) {
    :root {
        --bg-1: #eef4ff;
        --bg-2: #f7f8ff;
        --bg-3: #edf8f4;
        --panel: rgba(255, 255, 255, 0.78);
        --panel-strong: rgba(255, 255, 255, 0.9);
        --panel-soft: rgba(17, 24, 39, 0.04);
        --primary: #5d6df5;
        --primary-strong: #4c5ee8;
        --text: #172033;
        --muted: #5d6c86;
        --border: rgba(99, 120, 170, 0.15);
        --success-soft: rgba(52, 211, 153, 0.12);
        --danger-soft: rgba(255, 123, 123, 0.1);
        --shadow: 0 20px 60px rgba(53, 66, 104, 0.16);
    }

    body {
        background:
            radial-gradient(circle at top left, rgba(93, 109, 245, 0.16), transparent 20%),
            radial-gradient(circle at bottom right, rgba(52, 211, 153, 0.12), transparent 26%),
            linear-gradient(135deg, #eef4ff 0%, #f7f9ff 48%, #eef8f5 100%);
    }

    .app {
        background: rgba(255, 255, 255, 0.7);
        border-color: rgba(255, 255, 255, 0.6);
    }

    .header h1,
    .tasks-section h2 {
        color: #1b2333;
    }

    .task {
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 16px 26px rgba(50, 63, 92, 0.07);
    }

    .task-actions button {
        background: #eef2ff;
        color: #1b2333;
    }

    .filter {
        background: rgba(93, 109, 245, 0.06);
    }

    .task-input {
        background: rgba(255, 255, 255, 0.7);
    }
}
/* Recording overlay */

.recording-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(7, 11, 23, 0.58);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.recording-overlay.hidden {
    display: none;
}

.recording-overlay[hidden] {
    display: none !important;
}

.recording-card {
    width: min(440px, 100%);
    padding: 42px 32px 30px;
    text-align: center;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45), inset 0 1px rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    animation: recordingCardIn 0.3s ease both;
}

.recording-orb {
    width: 118px;
    height: 118px;
    margin: 0 auto 26px;
    position: relative;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, var(--primary), var(--primary-strong) 58%, #26327e);
    box-shadow: 0 0 0 12px var(--primary-soft), 0 0 44px rgba(124, 140, 255, 0.42);
}

.recording-mic {
    position: relative;
    z-index: 2;
    font-size: 2.8rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.recording-wave {
    position: absolute;
    inset: -12px;
    border: 1px solid rgba(174, 183, 255, 0.65);
    border-radius: 50%;
    animation: recordingWave 2s ease-out infinite;
}

.wave-two {
    animation-delay: 1s;
}

.recording-status {
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.recording-card h2 {
    font-size: 1.55rem;
    margin-bottom: 8px;
}

.recording-hint {
    color: var(--muted);
    line-height: 1.5;
    min-height: 24px;
}

.recording-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 26px;
}

.recording-stop-button,
.recording-cancel-button {
    border: 0;
    border-radius: 12px;
    padding: 12px 17px;
    cursor: pointer;
    font-weight: 800;
}

.recording-stop-button {
    color: white;
    background: linear-gradient(135deg, var(--danger) 0%, #d95768 100%);
}

.recording-cancel-button {
    color: var(--text);
    background: var(--panel-soft);
    border: 1px solid var(--border);
}

@keyframes recordingWave {
    0% { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(1.35); opacity: 0; }
}

@keyframes recordingCardIn {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* AI Confirmation Modal */

.modal {
    position: fixed;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 0.5);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    width: 90%;
    max-width: 600px;

    background: white;

    border-radius: 12px;

    padding: 25px;

    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 15px;
}

.modal-header h2 {
    font-size: 22px;
}

.close-button {
    border: none;
    background: transparent;

    font-size: 20px;
    cursor: pointer;
}

.ai-transcript {
    color: #666;
    font-size: 14px;

    margin-bottom: 20px;

    padding-bottom: 15px;

    border-bottom: 1px solid #eee;
}

.ai-task {
    background: #f7f7f7;

    border: 1px solid #e5e5e5;

    border-radius: 8px;

    padding: 15px;

    margin-bottom: 10px;
}

.ai-task-title {
    font-weight: 600;

    margin-bottom: 8px;
}

.ai-task-details {
    color: #666;

    font-size: 14px;
}

.ai-task-details span {
    margin-right: 15px;
}

.ai-task-details .priority-high {
    color: #8b1e2d;
}

.ai-task-details .priority-medium {
    color: #14532d;
}

.ai-task-details .priority-low {
    color: #4b5563;
}

.modal-actions {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 20px;
}

.cancel-button,
.confirm-button {
    border: none;

    padding: 10px 16px;

    border-radius: 7px;

    cursor: pointer;
}

.cancel-button {
    background: #eee;
}

.confirm-button {
    background: #222;
    color: white;
}