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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    background: #F5F5F4;
    min-height: 100vh;
    color: #1C1C1E;
}

/* Main Content */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px;
}

header {
    margin-bottom: 32px;
}

header h1 {
    font-size: 1.875rem;
    font-weight: 600;
    color: #1C1C1E;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 0.875rem;
    color: #6B7280;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 16px;
    }
}

.input-section,
.results-section {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #E5E7EB;
}

h2 {
    color: #1C1C1E;
    margin-bottom: 16px;
    font-size: 1.125rem;
    font-weight: 600;
}

h3 {
    color: #1C1C1E;
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 600;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
    background: #FFFFFF;
    color: #1C1C1E;
}

textarea:focus {
    outline: none;
    border-color: #22C55E;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.threshold-section {
    margin: 20px 0;
}

.threshold-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1C1C1E;
    font-size: 0.875rem;
}

#thresholdValue {
    color: #22C55E;
    font-size: 1rem;
    font-weight: 600;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #E5E7EB;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #22C55E;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #22C55E;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.threshold-help {
    font-size: 0.75rem;
    color: #6B7280;
    margin-top: 6px;
}

.btn-primary {
    width: 100%;
    padding: 12px 16px;
    background: #22C55E;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

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

.btn-primary:active {
    transform: translateY(0);
}

.examples {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #E5E7EB;
}

.examples p {
    margin-bottom: 10px;
    color: #6B7280;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.example-btn {
    display: inline-block;
    margin: 4px;
    padding: 6px 12px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #1C1C1E;
}

.example-btn:hover {
    background: #22C55E;
    color: white;
    border-color: #22C55E;
}

.prediction-card,
.probabilities-card,
.info-card {
    background: #F9FAFB;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #E5E7EB;
}

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

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22C55E;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge.warning {
    background: rgba(234, 179, 8, 0.1);
    color: #EAB308;
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.department-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1C1C1E;
    margin-bottom: 12px;
}

.confidence-bar {
    width: 100%;
    height: 24px;
    background: #E5E7EB;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.confidence-fill {
    height: 100%;
    background: #22C55E;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
}

.confidence-text {
    font-size: 0.875rem;
    margin-bottom: 8px;
    color: #1C1C1E;
}

.action-reason {
    color: #6B7280;
    font-size: 0.8125rem;
}

.prob-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.prob-label {
    width: 160px;
    font-weight: 500;
    font-size: 0.8125rem;
    color: #1C1C1E;
}

.prob-bar-container {
    flex: 1;
    height: 18px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 8px;
}

.prob-bar {
    height: 100%;
    background: #8B5CF6;
    transition: width 0.3s ease;
}

.prob-value {
    width: 50px;
    text-align: right;
    font-weight: 600;
    color: #6B7280;
    font-size: 0.8125rem;
}

.info-card {
    background: rgba(139, 92, 246, 0.05);
    border-left: 3px solid #8B5CF6;
}

.info-card h4 {
    color: #1C1C1E;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 600;
}

.info-card ul {
    margin-left: 16px;
}

.info-card li {
    margin-bottom: 6px;
    color: #6B7280;
    font-size: 0.8125rem;
}

.loading {
    text-align: center;
    padding: 32px;
    background: #FFFFFF;
    border-radius: 12px;
    grid-column: 1 / -1;
    border: 1px solid #E5E7EB;
}

.spinner {
    border: 3px solid #E5E7EB;
    border-top: 3px solid #22C55E;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

.loading p {
    color: #6B7280;
    font-size: 0.875rem;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid #EF4444;
    grid-column: 1 / -1;
    font-size: 0.875rem;
}

footer {
    text-align: center;
    color: #6B7280;
    padding: 16px;
    background: #FFFFFF;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    margin-top: 24px;
}

footer p {
    margin-bottom: 4px;
    font-size: 0.8125rem;
}

.note {
    font-size: 0.75rem;
    color: #9CA3AF;
}
