* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
}

.container {
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
}

header h1 {
    font-size: 48px;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 18px;
    opacity: 0.9;
}

main {
    padding: 40px 20px;
}

/* Intro Section */
.intro-section {
    margin-bottom: 40px;
}

.info-box {
    background: #f0f4ff;
    border-left: 4px solid #667eea;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.info-box h2 {
    color: #667eea;
    font-size: 18px;
    margin-bottom: 10px;
}

.info-box p {
    font-size: 15px;
    line-height: 1.6;
    color: #555;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 8px;
}

.input-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.input-help {
    margin-top: 8px;
    color: #6b7280;
    font-size: 13px;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 18px;
    padding: 16px 32px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #667eea;
    color: white;
    flex: 1;
}

.btn-secondary:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-outline {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    flex: 1;
}

.btn-outline:hover {
    background: #f0f4ff;
    transform: translateY(-2px);
}

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-icon {
    font-size: 20px;
}

/* Loading Section */
.loading-section {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid #f0f0f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-section p {
    font-size: 18px;
    color: #333;
    margin: 10px 0;
}

.loading-sub {
    font-size: 14px;
    color: #999 !important;
}

/* Result Section */
.result-section {
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e5e7eb;
}

.score-circle {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.score-circle.low {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 3px solid #28a745;
}

.score-circle.medium {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 3px solid #ffc107;
}

.score-circle.high {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 3px solid #dc3545;
}

.score-value {
    font-size: 42px;
}

.score-label {
    font-size: 12px;
    opacity: 0.7;
}

.score-text h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #333;
}

.risk-level {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.detail-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.detail-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #999;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    word-break: break-all;
}

.detail-value.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
}

.badge.low {
    background: #d4edda;
    color: #155724;
}

.badge.medium {
    background: #fff3cd;
    color: #856404;
}

.badge.high {
    background: #f8d7da;
    color: #721c24;
}

/* Info Cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.info-card {
    background: #f9fafb;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.info-card h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.info-card ul {
    list-style: none;
}

.info-card li {
    padding: 8px 0;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
}

.info-card li:before {
    content: "✓";
    color: #667eea;
    font-weight: bold;
    margin-right: 10px;
}

/* Footer */
footer {
    background: #f9fafb;
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

footer p {
    font-size: 14px;
    color: #666;
    margin: 8px 0;
}

footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

.footer-small {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 36px;
    }

    main {
        padding: 25px 15px;
    }

    .score-display {
        flex-direction: column;
        text-align: center;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group .btn {
        width: 100%;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .info-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        border-radius: 8px;
    }

    header {
        padding: 30px 15px;
    }

    header h1 {
        font-size: 28px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .input-group input {
        font-size: 14px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        color: #e0e0e0;
    }

    .container {
        background: #1e1e1e;
    }

    .info-box {
        background: #2d2d4a;
        border-left-color: #667eea;
    }

    .info-box h2 {
        color: #7c8dff;
    }

    .info-box p {
        color: #b0b0b0;
    }

    .result-card {
        background: #2a2a2a;
        border-color: #3d3d3d;
    }

    .detail-item {
        background: #262626;
        color: #e0e0e0;
    }

    .detail-label {
        color: #888;
    }

    .detail-value {
        color: #e0e0e0;
    }

    .info-card {
        background: #262626;
        border-color: #3d3d3d;
        color: #e0e0e0;
    }

    .info-card h3 {
        color: #e0e0e0;
    }

    .info-card li {
        color: #b0b0b0;
    }

    footer {
        background: #262626;
        border-top-color: #3d3d3d;
    }

    footer p {
        color: #b0b0b0;
    }
}