/* =========================================
   iCal Event Builder — Styles
   Rose Gold: #F43F5E / #FB7185 / #2DD4BF
   Background: #1A0A10
   ========================================= */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #F43F5E;
    --primary-light: #FB7185;
    --primary-dark: #E11D48;
    --primary-glow: rgba(244, 63, 94, 0.15);
    --accent: #2DD4BF;
    --accent-glow: rgba(45, 212, 191, 0.12);
    --bg-base: #1A0A10;
    --bg-surface: #261218;
    --bg-elevated: #321820;
    --bg-hover: #3E202A;
    --bg-input: #140810;
    --text-primary: #F8F0F2;
    --text-secondary: #FB7185;
    --text-muted: #8B6B73;
    --border: #3E202A;
    --success: #10B981;
    --error: #EF4444;
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: 200ms ease;
}

body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.header {
    padding: 20px 0 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    box-shadow: 0 0 20px var(--primary-glow);
}

h1 {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    padding: 8px 16px;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

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

.btn-sm {
    font-size: 0.78rem;
    padding: 6px 12px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 0 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
}

.btn-accent {
    background: var(--accent);
    color: var(--bg-base);
    font-weight: 600;
}

.btn-link {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    flex: 1;
    justify-content: center;
}

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

.layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    align-items: start;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.card h2 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-header h2 {
    margin-bottom: 0;
}

.sticky {
    position: sticky;
    top: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
}

.form-group label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-row {
    display: flex;
    gap: 12px;
}

.grow {
    flex: 1;
}

.input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.85rem;
    padding: 9px 12px;
    transition: border-color var(--transition);
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.select {
    cursor: pointer;
}

.textarea {
    font-family: var(--font);
    resize: vertical;
}

/* Toggle */
.toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 22px;
    transition: all var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all var(--transition);
}

.toggle input:checked+.toggle-slider {
    background: var(--primary);
}

.toggle input:checked+.toggle-slider::before {
    transform: translateX(18px);
    background: #fff;
}

/* Weekday */
.weekday-row {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.weekday-btn {
    cursor: pointer;
}

.weekday-btn input {
    display: none;
}

.weekday-btn span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition);
}

.weekday-btn input:checked+span {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.rrule-preview {
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--accent);
    font-family: var(--font-mono);
    background: var(--bg-input);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    word-break: break-all;
}

/* Attendees */
.attendees-list,
.reminders-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.attendee-row,
.reminder-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.attendee-row .input {
    flex: 1;
}

.links-row {
    display: flex;
    gap: 8px;
}

/* ICS Preview */
.ics-preview {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 14px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    line-height: 1.5;
    overflow: auto;
    max-height: 600px;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 20px;
    font-size: 0.85rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    z-index: 200;
    opacity: 0;
    transition: all 250ms ease;
    pointer-events: none;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.hidden {
    display: none !important;
}

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

    .form-row {
        flex-direction: column;
    }

    .sticky {
        position: static;
    }
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}