/* Core Variables & Theming */
:root {
    --primary: #3B82F6;
    --primary-hover: #2563EB;
    --secondary: #93C5FD;
    --accent: #10B981;
    --accent-hover: #059669;
    --danger: #EF4444;
    --warning: #F59E0B;
    --bg-color: #0B1426;
    --surface: rgba(30, 41, 59, 0.4);
    --border: rgba(147, 197, 253, 0.15);
    --text-active: #F8FAFC;
    --text-muted: #94A3B8;
    --radius: 12px;
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-active);
    min-height: 100vh;
    /* Soft glowing background */
    background-image:
        radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.1) 0, transparent 400px),
        radial-gradient(circle at 0% 100%, rgba(16, 185, 129, 0.05) 0, transparent 400px);
    background-attachment: fixed;
}

/* Utilities */
.glass {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-radius: var(--radius);
}

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

.text-sm {
    font-size: 0.85rem;
}

.hidden {
    display: none !important;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 16px;
}

.mt-4 {
    margin-top: 24px;
}

.mb-3 {
    margin-bottom: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-active);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

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

.btn-outline {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

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

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 8px;
    border-radius: 8px;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--secondary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    color: var(--text-active);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

textarea.form-control {
    resize: vertical;
}

.input-with-btn {
    display: flex;
    gap: 8px;
}

/* Layout Container */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-left: none;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary);
}

.sidebar-nav {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.nav-item:hover {
    color: var(--text-active);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    display: flex;
    justify-content: center;
}

.view-section {
    width: 100%;
    max-width: 900px;
    animation: fadeIn 0.3s ease;
}

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

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

.section-header {
    margin-bottom: 32px;
}

.section-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.card {
    padding: 32px;
}

/* Grid Layouts */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.result-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.result-item.full-width {
    grid-column: 1 / -1;
}

.result-item .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.result-item strong {
    font-size: 1.5rem;
    color: var(--secondary);
}

.calculated-output {
    padding: 24px;
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.version-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.version-display h2 {
    font-size: 2.5rem;
    font-family: monospace;
    letter-spacing: -1px;
    color: var(--primary);
}

/* Two Col layout for compare */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.align-start {
    align-items: start;
}

/* Status Results */
.status-result {
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.status-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.compare-result-box {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.batch-results-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.batch-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: monospace;
    font-weight: 600;
}

.batch-badge.sat {
    background: var(--accent);
    color: #fff;
}

.batch-badge.unsat {
    background: var(--danger);
    color: #fff;
}

/* Changelog Preview */
.changelog-preview-box {
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.preview-content {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 16px;
    overflow-y: auto;
}

.preview-content pre {
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-active);
    line-height: 1.5;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: var(--accent);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    z-index: 100;
    transition: var(--transition);
}

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

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

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
    }

    .sidebar-nav .nav-item {
        white-space: nowrap;
    }

    .main-content {
        padding: 20px;
    }

    .two-col-grid {
        grid-template-columns: 1fr;
    }
}