:root {
    --bg-base: #0f172a;
    --bg-panel: #1e293b;
    --bg-panel-hover: #334155;

    --border-dim: rgba(255, 255, 255, 0.1);
    --border-highlight: rgba(255, 255, 255, 0.2);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-dim: rgba(59, 130, 246, 0.2);

    --grad-1: #6366f1;
    --grad-2: #ec4899;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

svg {
    display: block;
}

.w-4 {
    width: 1rem;
}

.h-4 {
    height: 1rem;
}

.w-5 {
    width: 1.25rem;
}

.h-5 {
    height: 1.25rem;
}

.w-6 {
    width: 1.5rem;
}

.h-6 {
    height: 1.5rem;
}

.w-12 {
    width: 3rem;
}

.h-12 {
    height: 3rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.hidden {
    display: none !important;
}

/* Layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 380px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-dim);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-dim);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.text-gradient {
    background: linear-gradient(135deg, var(--grad-1), var(--grad-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-content {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Forms */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

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

input[type="text"],
input[type="number"],
textarea {
    width: 100%;
    background-color: var(--bg-base);
    border: 1px solid var(--border-dim);
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    resize: vertical;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--grad-1), var(--grad-2));
    color: white;
    border: none;
    padding: 0.875rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.2s ease, opacity 0.2s ease, filter 0.2s;
    margin-top: auto;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-panel-hover);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-dim);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--bg-panel);
    border-color: var(--border-highlight);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    color: #ef4444;
    /* red */
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Workspace */
.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-base);
    position: relative;
}

.workspace-header {
    height: 73px;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-dim);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.workspace-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.agenda-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

/* Empty State */
.empty-state {
    margin: auto;
    text-align: center;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    animation: fadeIn 0.5s ease;
}

.empty-icon-wrapper {
    background: var(--bg-panel);
    padding: 1.5rem;
    border-radius: 50%;
    border: 1px dashed var(--border-highlight);
    margin-bottom: 0.5rem;
}

/* Agenda View */
.agenda-view {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    animation: slideUp 0.4s ease forwards;
}

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

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.agenda-meta {
    margin-bottom: 2rem;
}

#outTitle {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.duration-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--bg-panel);
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent-hover);
    border: 1px solid var(--border-dim);
}

/* Time Bar */
.time-allocation-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-panel);
    border-radius: 4px;
    display: flex;
    overflow: hidden;
    margin-bottom: 2rem;
}

.time-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-dim);
    padding-bottom: 0.5rem;
}

/* Agenda List */
.agenda-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.agenda-item {
    background: var(--bg-panel);
    border: 1px solid var(--border-dim);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    cursor: grab;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    user-select: none;
}

.agenda-item.sortable-ghost {
    opacity: 0.4;
    background: var(--bg-base);
    border-style: dashed;
}

.agenda-item.sortable-drag {
    cursor: grabbing;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.agenda-item:hover {
    border-color: var(--border-highlight);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.item-drag-handle {
    color: var(--text-muted);
    cursor: grab;
    display: flex;
    align-items: flex-start;
    padding-top: 0.25rem;
}

.item-drag-handle svg {
    width: 1.25rem;
    height: 1.25rem;
}

.item-content {
    flex: 1;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.item-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-main);
}

.item-time {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    font-family: monospace;
    font-weight: 600;
}

.item-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    white-space: pre-wrap;
}

.item-action-items {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--accent);
    padding: 0.75rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

.item-action-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent-hover);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.action-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.action-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-main);
}

.action-list li::before {
    content: "☐";
    color: var(--accent);
    font-size: 1rem;
    line-height: 1;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-main);
    color: var(--bg-base);
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-weight: 500;
    font-size: 0.875rem;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 50;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

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

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-dim);
    }

    .sidebar-content {
        max-height: 50vh;
    }

    .workspace-header {
        padding: 0 1rem;
    }

    .agenda-container {
        padding: 1rem;
    }
}