/* ========================================
   AI Meeting Cost Calculator — Premium Dark Theme
   Indigo + Cyan Palette
   ======================================== */

:root {
    --primary: #6366F1;
    --primary-hover: #5558E6;
    --primary-glow: rgba(99, 102, 241, 0.3);
    --accent: #22D3EE;
    --accent-hover: #06B6D4;
    --accent-glow: rgba(34, 211, 238, 0.2);
    --danger: #F87171;
    --danger-hover: #EF4444;
    --success: #34D399;

    --bg-base: #0F172A;
    --bg-surface: #1E293B;
    --bg-elevated: #273548;
    --bg-input: #1A2437;
    --bg-hover: #334155;

    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    --border: rgba(99, 102, 241, 0.15);
    --border-active: rgba(99, 102, 241, 0.4);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;

    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --transition: 200ms ease;

    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(99, 102, 241, 0.1);
    --glass-blur: blur(16px);
}

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

html {
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 30% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 100%, rgba(34, 211, 238, 0.05) 0%, transparent 50%);
}

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

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

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

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #818CF8);
    color: white;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--primary-glow);
}

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

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-active);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #06B6D4);
    color: #0F172A;
    font-weight: 700;
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.1);
}

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

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

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--radius);
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.78rem;
}

.hidden {
    display: none !important;
}

/* Inputs */
.input {
    font-family: var(--font);
    font-size: 0.9rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color var(--transition);
    outline: none;
}

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

.input::placeholder {
    color: var(--text-muted);
}

.input-sm {
    width: 90px;
}

/* Cost Display */
.cost-display {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.cost-display::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.06) 0%, transparent 60%);
    animation: pulse-bg 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse-bg {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.cost-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    position: relative;
}

.cost-value {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    line-height: 1.1;
    position: relative;
    transition: transform 0.15s ease;
}

.cost-value.bump {
    transform: scale(1.02);
}

.cost-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    position: relative;
}

.meta-divider {
    color: var(--text-muted);
}

.meeting-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
}

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: border-color var(--transition);
}

.card:hover {
    border-color: var(--border-active);
}

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

.card-header h2 {
    font-size: 1rem;
    font-weight: 700;
}

.badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    background: var(--primary-glow);
    color: var(--primary);
}

/* Columns */
.columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Attendees */
.add-attendee-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.add-attendee-form .input:first-child {
    flex: 1;
}

.quick-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.role-chip {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.role-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

.attendee-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.attendee-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid transparent;
    animation: slideIn 0.3s ease;
}

.attendee-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.attendee-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.attendee-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.attendee-rate {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: all var(--transition);
}

.btn-remove:hover {
    color: var(--danger);
    background: rgba(248, 113, 113, 0.1);
}

/* Summary */
.summary-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

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

.summary-row .label {
    color: var(--text-muted);
}

.summary-row .value {
    font-weight: 700;
    color: var(--text-primary);
}

.summary-row .value.highlight {
    color: var(--accent);
}

/* ROI */
.roi-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.roi-form label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.roi-result {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    margin-top: 0.5rem;
}

.roi-positive {
    background: rgba(52, 211, 153, 0.1);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.roi-negative {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.roi-neutral {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Alternatives */
.alternatives-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.alt-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    transition: all var(--transition);
}

.alt-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.alt-icon {
    font-size: 1.5rem;
}

.alt-item strong {
    font-size: 0.9rem;
    display: block;
}

.alt-item p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Right Column */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: min(90vw, 560px);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.05rem;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.btn-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

/* History */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-item {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.history-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.history-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.history-cost {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.5s forwards;
}

.toast-success {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.toast-info {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        pointer-events: none;
    }
}

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

    .cost-value {
        font-size: 2.5rem;
    }

    .meeting-controls {
        flex-wrap: wrap;
    }

    .add-attendee-form {
        flex-wrap: wrap;
    }

    .add-attendee-form .input:first-child {
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .app-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .cost-display {
        padding: 2rem 1rem;
    }

    .cost-value {
        font-size: 2rem;
    }

    .cost-meta {
        flex-direction: column;
        gap: 0.25rem;
    }

    .meta-divider {
        display: none;
    }
}