:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #06b6d4;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --dark-bg: #1e293b;
    --sidebar-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    color: #334155;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

.btn-primary {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
    border: none;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
}

.btn-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.btn-link:hover {
    color: var(--primary-color);
}

.content {
    padding-top: 1.5rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 2px solid var(--success-color);
    border-radius: 0.375rem;
}

.invalid {
    outline: 2px solid var(--danger-color);
    border-radius: 0.375rem;
}

.validation-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-control {
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    padding: 0.625rem 0.875rem;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-label {
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.5rem;
}

.card {
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem 0.75rem 0 0;
}

.card-body {
    padding: 1.5rem;
}

.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border-color);
}

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.alert {
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

#blazor-error-ui {
    background: #fef3c7;
    bottom: 0;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    display: none;
    left: 0;
    padding: 0.75rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    border-top: 2px solid #f59e0b;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.75rem;
    color: #92400e;
}

.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    background-color: #f8fafc;
}

.sidebar {
    background: var(--sidebar-bg);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.top-row {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    justify-content: flex-end;
    height: 4rem;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.top-row a, .top-row .btn-link {
    white-space: nowrap;
    margin-left: 1.5rem;
    text-decoration: none;
    font-weight: 500;
}

.top-row .user-info {
    margin-right: 1rem;
    color: #475569;
    font-weight: 500;
}

/* Hamburger button - visible on small screens */
.hamburger-btn {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    padding: 0.5rem;
    margin-right: auto;
    color: var(--dark-bg);
}

.hamburger-btn:hover {
    color: var(--primary-color);
}

/* Mobile: sidebar hidden by default */
@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        width: 260px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease-in-out;
    }

    .sidebar.expanded {
        left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .top-row .user-info {
        display: none;
    }
}

/* Desktop: sidebar always visible, hamburger hidden */
@media (min-width: 768px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 260px;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    main {
        margin-left: 260px;
        width: calc(100% - 260px);
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }

    main > div {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }

    .hamburger-btn {
        display: none;
    }

    .sidebar-overlay {
        display: none;
    }
}

.sidebar .top-row {
    background-color: rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.025em;
}

.sidebar .oi {
    width: 2rem;
    font-size: 1.1rem;
    vertical-align: text-top;
    top: -2px;
}

.sidebar .nav-item {
    font-size: 0.9rem;
    padding: 0.25rem 1rem;
}

.sidebar .nav-item:first-of-type {
    padding-top: 1rem;
}

.sidebar .nav-item:last-of-type {
    padding-bottom: 1rem;
}

.sidebar .nav-item a {
    color: var(--text-muted);
    border-radius: 0.5rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar .nav-item a.active {
    background-color: rgba(79, 70, 229, 0.15);
    color: white;
}

.sidebar .nav-item a:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.modal {
    background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 0.75rem 0.75rem 0 0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    border-radius: 0 0 0.75rem 0.75rem;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

.spinner-border {
    color: var(--primary-color);
}

h1, h2, h3, h4, h5, h6 {
    color: #0f172a;
    font-weight: 700;
}

.container {
    max-width: 1200px;
}

/* Markdown Preview Styles */
.markdown-preview h1 {
    font-size: 2rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.markdown-preview h2 {
    font-size: 1.5rem;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}

.markdown-preview h3 {
    font-size: 1.25rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.markdown-preview p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.markdown-preview ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.markdown-preview li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.markdown-preview strong {
    font-weight: 600;
    color: #1e293b;
}

.markdown-preview em {
    font-style: italic;
    color: #475569;
}

/* Utility Classes for Layout */
.full-viewport-height {
    height: 100vh;
}

.min-height-80vh {
    min-height: 80vh;
}

/* Modal Backdrop */
.modal-backdrop-overlay {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Icon Utilities */
.icon-large {
    font-size: 4rem;
    color: #cbd5e1;
}

.icon-success {
    color: var(--success-color);
}

.icon-primary {
    color: var(--primary-color);
}

.icon-info {
    color: var(--info-color);
}

.icon-secondary {
    color: var(--secondary-color);
}

/* Step Wizard Styles */
.step-badge {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.step-connector {
    height: 2px;
}

.step-connector-active {
    background-color: #0d6efd;
}

.step-connector-inactive {
    background-color: #dee2e6;
}

/* Scrollable Content Areas */
.scrollable-code {
    max-height: 500px;
    overflow-y: auto;
}

.scrollable-alert {
    max-height: 150px;
    overflow-y: auto;
}

.scrollable-error {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

/* Progress Bar */
.progress-bar-large {
    height: 25px;
}

/* Hidden File Input */
.file-input-hidden {
    display: none;
}

/* Card Body Padding */
.card-body-large-padding {
    padding: 2rem;
}

/* Primary Color Text */
.text-primary-color {
    color: var(--primary-color);
}
