@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    height: 100vh;
    overflow: hidden;
}

/* Container and layout - optimized for 1024x768 */
.page-container {
    max-width: 1024px;
    height: 768px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

/* Branded header layout */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: #1f2937;
    flex-shrink: 0;
}

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

.company-logo {
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.company-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.025em;
}

.company-name .primary {
    color: #dc2626;
}

.company-name .secondary {
    color: #6b7280;
    font-weight: 500;
}

.app-title-section {
    text-align: right;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    letter-spacing: -0.025em;
        line-height: 1.25em;
    color: #1f2937;
}

.page-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.8;
    max-width: 300px;
    line-height: 1.25em;
    margin-left: auto;
    color: #6b7280;
}

/* Progress Bar */
.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0 1rem;
}

.progress-step {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    color: #6b7280;
}

.progress-step.active {
    color: #dc2626;
    font-weight: 600;
}

.progress-step.completed {
    color: #059669;
}

.progress-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #d1d5db;
    margin-right: 0.5rem;
}

.progress-step.active .progress-dot {
    background: #dc2626;
}

.progress-step.completed .progress-dot {
    background: #059669;
}

/* Single panel layout */
.main-panel {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
    flex-shrink: 0;
}

/* Wizard steps */
.wizard-step {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.wizard-step.active {
    display: flex;
}

.wizard-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.nav-button {
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-button:hover:not(:disabled) {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-button.primary {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

.nav-button.primary:hover:not(:disabled) {
    background: #b91c1c;
    border-color: #b91c1c;
}

/* Demo scenarios step */
.demo-scenarios-step {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.demo-intro {
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.demo-intro h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.demo-intro p {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.demo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex: 1;
}

.demo-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.demo-card:hover {
    border-color: #dc2626;
    background: #fef2f2;
}

.demo-card.selected {
    border-color: #dc2626;
    background: #fef2f2;
}

.demo-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #374151;
}

.demo-card p {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
}

/* Form styles - compact for single pane */
.form-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-group {
    margin-bottom: 0.75rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
    text-transform: capitalize;
}

.form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 400;
    background-color: white;
    color: #1f2937;
    transition: all 0.2s ease;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-select:hover {
    border-color: #d1d5db;
}

/* Button styles */
.primary-button {
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.primary-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.primary-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading state */
.loading-state {
    display: none;
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #dc2626;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

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

/* Results section */
.results-container {
    display: none;
    flex: 1;
    overflow-y: auto;
}

.urgency-card {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    text-align: center;
    border-left: 4px solid;
}

.urgency-card.low {
    background: #f0fdf4;
    border-left-color: #27ae60;
}

.urgency-card.normal {
    background: #fefce8;
    border-left-color: #f39c12;
}

.urgency-card.extended {
    background: #fef2f2;
    border-left-color: #e67e22;
}

.urgency-card.critical {
    background: #fef2f2;
    border-left-color: #e74c3c;
}

.prediction-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.urgency-message {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Explanation section */
.explanation-section {
    background: #f8fafc;
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
}

.explanation-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #374151;
}

.explanation-list {
    list-style: none;
}

.explanation-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: #4b5563;
}

.explanation-item:last-child {
    border-bottom: none;
}

/* Error state */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Responsive design for iframe */
@media (max-width: 768px) {
    .page-container {
        padding: 0.75rem;
    }
    
    .main-panel {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .company-name {
        font-size: 1.25rem;
    }
    
    .demo-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }