/* iCal Merger — styles.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg: #0c1a2e;
    --bg2: #111f38;
    --bg3: #162540;
    --bg4: #1c2d4e;
    --border: #1c2d4e;
    --border2: rgba(255, 255, 255, 0.05);
    --text: #d0e8ff;
    --text2: #4a7ab0;
    --text3: #2a4a74;
    --primary: #0984e3;
    --primary2: #74b9ff;
    --primary3: #0660a8;
    --accent: #fd79a8;
    --green: #55efc4;
    --yellow: #fdcb6e;
    --red: #ff7675;
    --radius: 12px;
    --t: all 0.2s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.bg-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 55% 40% at 5% 5%, rgba(9, 132, 227, 0.09), transparent), radial-gradient(ellipse 40% 25% at 90% 90%, rgba(253, 121, 168, 0.05), transparent);
    z-index: 0;
}

/* Header */
header {
    background: rgba(12, 26, 46, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.hdr {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #0984e3, #0660a8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    box-shadow: 0 0 16px rgba(9, 132, 227, 0.25);
}

.brand-title {
    font-size: 14px;
    font-weight: 700;
}

h1.brand-title {
    display: inline;
}

.brand-sub {
    font-size: 10px;
    color: var(--text3);
}

/* Layout */
.layout {
    max-width: 1200px;
    margin: 14px auto;
    padding: 0 20px 48px;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 14px;
    position: relative;
    z-index: 1;
    align-items: start;
}

.left-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.right-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Drop zone */
.drop-zone {
    background: rgba(17, 31, 56, 0.6);
    backdrop-filter: blur(10px);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--t);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(9, 132, 227, 0.06);
}

.drop-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.drop-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.drop-sub {
    font-size: 11px;
    color: var(--text3);
}

/* Panels */
.panel {
    background: rgba(17, 31, 56, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.panel-title-row {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text2);
}

/* Sources */
.sources-list {
    display: flex;
    flex-direction: column;
}

.source-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border2);
}

.source-row:last-child {
    border-bottom: none;
}

.src-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.src-name {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.src-count {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text3);
}

.src-toggle {
    background: none;
    border: 1px solid var(--border2);
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    padding: 1px 6px;
    color: var(--text2);
    transition: var(--t);
}

.src-toggle:hover {
    border-color: var(--primary);
    color: var(--primary2);
}

.src-rm {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text3);
    font-size: 13px;
    line-height: 1;
    padding: 0;
}

.src-rm:hover {
    color: var(--red);
}

/* Options */
.options-body {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.opt-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 7px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--t);
}

.opt-row:has(input:checked) {
    background: rgba(9, 132, 227, 0.1);
    border-color: rgba(9, 132, 227, 0.2);
}

.opt-row input[type=radio] {
    margin-top: 2px;
    accent-color: var(--primary);
}

.opt-label {
    font-size: 12px;
    font-weight: 600;
}

.opt-desc {
    font-size: 10px;
    color: var(--text3);
    margin-top: 1px;
}

/* Search */
.search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(17, 31, 56, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 10px;
    backdrop-filter: blur(10px);
}

.search-ic {
    flex-shrink: 0;
}

.search-inp {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.search-inp::placeholder {
    color: var(--text3);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: rgba(17, 31, 56, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.empty-sub {
    font-size: 12px;
    color: var(--text2);
    max-width: 340px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Stats bar */
.stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 9px 12px;
    background: rgba(9, 132, 227, 0.07);
    border: 1px solid rgba(9, 132, 227, 0.15);
    border-radius: var(--radius);
    font-size: 11px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-val {
    font-weight: 700;
    color: var(--primary2);
}

/* Conflicts alert */
.conflicts-alert {
    padding: 9px 12px;
    background: rgba(253, 121, 168, 0.1);
    border: 1px solid rgba(253, 121, 168, 0.25);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--accent);
}

/* Events panel */
.events-panel {
    background: rgba(17, 31, 56, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.events-hdr {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.events-list {
    max-height: 65vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Event card */
.event-card {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border2);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    transition: background 0.15s;
}

.event-card:last-child {
    border-bottom: none;
}

.event-card:hover {
    background: rgba(9, 132, 227, 0.04);
}

.event-card.is-conflict {
    background: rgba(253, 121, 168, 0.05);
}

.evt-color {
    width: 3px;
    border-radius: 2px;
    align-self: stretch;
    flex-shrink: 0;
}

.evt-body {
    flex: 1;
    min-width: 0;
}

.evt-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.evt-line2 {
    display: flex;
    gap: 8px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.evt-time {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text3);
}

.evt-src {
    font-size: 10px;
    color: var(--text2);
}

.evt-conflict-badge {
    font-size: 9px;
    font-weight: 700;
    background: rgba(253, 121, 168, 0.2);
    border: 1px solid rgba(253, 121, 168, 0.3);
    color: var(--accent);
    padding: 1px 5px;
    border-radius: 3px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--bg3);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--t);
}

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

.btn-sm {
    padding: 3px 9px;
    font-size: 10px;
    border-radius: 6px;
}

.btn-dl {
    background: rgba(9, 132, 227, 0.12);
    border-color: rgba(9, 132, 227, 0.3);
    color: var(--primary2);
}

/* Toast */
.toast-wrap {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

.toast {
    background: var(--bg2);
    border: 1px solid rgba(9, 132, 227, 0.3);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--text);
    transform: translateX(20px);
    opacity: 0;
    transition: all 0.22s ease;
}

.toast.show {
    transform: none;
    opacity: 1;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px
}

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

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

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