/**
 * STOP-Bang Assessment Tool - Public Styles
 * 
 * @package StopBangAssessment
 * @version 1.0.0
 */

/* Container and Layout */
.stopbang-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.stopbang-container * {
    box-sizing: border-box;
}

/* Step Management */
.stopbang-step {
    display: none;
    animation: stopbangFadeIn 0.5s ease;
}

.stopbang-step.active {
    display: block;
}

@keyframes stopbangFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card Styles */
.stopbang-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 30px;
    text-align: center;
}

.stopbang-card h2 {
    color: #333;
    margin: 0 0 20px;
    font-size: 28px;
    font-weight: 600;
}

.stopbang-card h3 {
    color: #555;
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 500;
}

.stopbang-card p {
    color: #666;
    margin: 0 0 25px;
    font-size: 16px;
    line-height: 1.6;
}

.stopbang-meta {
    font-size: 14px !important;
    color: #888 !important;
}

/* Buttons */
.stopbang-btn {
    background: #f1b434;
    color: #58595b;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
    display: inline-block;
    text-decoration: none;
    font-weight: 500;
}

.stopbang-btn:hover {
    background: #009CDE;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 156, 222, 0.3);
}

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

.stopbang-btn:disabled {
    background: #ccc;
    color: #999;
    cursor: not-allowed;
    transform: none;
}

.stopbang-btn-primary {
    background: #667eea;
    color: white;
}

.stopbang-btn-primary:hover {
    background: #5a67d8;
}

.stopbang-btn-secondary {
    background: #6c757d;
    color: white;
}

.stopbang-btn-secondary:hover {
    background: #5a6268;
}

.stopbang-btn-info {
    background: #17a2b8;
    color: white;
}

.stopbang-btn-info:hover {
    background: #138496;
}

/* Input Fields */
.stopbang-input,
.stopbang-select {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background-color: white;
}

.stopbang-input:focus,
.stopbang-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Options Grid */
.stopbang-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.stopbang-option {
    background: #f7fafc;
    border: 2px solid #B2E1F5;
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    font-weight: 500;
}

.stopbang-option:hover {
    border-color: #F1B434;
    background: #FFF9E6;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(241, 180, 52, 0.2);
}

.stopbang-option.selected {
    background: #F1B434;
    color: white;
    border-color: #F1B434;
}

/* Navigation Buttons */
.stopbang-nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.stopbang-nav-buttons > div {
    min-width: 100px;
}

/* Progress Bar */
.stopbang-progress-bar {
    background: #e2e8f0;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 30px;
    overflow: hidden;
}

.stopbang-progress-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Input Groups */
.stopbang-input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.stopbang-input-item {
    text-align: left;
}

.stopbang-input-item label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.stopbang-location-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

/* BMI Display */
.stopbang-bmi-display {
    background: #f0f4f8;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 16px;
}

.stopbang-bmi-value {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

/* Neck Info */
.stopbang-neck-info {
    background: #e8f0fe;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: left;
    font-size: 14px;
    line-height: 1.6;
}

/* Question Styles */
.stopbang-question-text {
    text-align: left;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 10px;
    color: #333;
    font-weight: 500;
}

.stopbang-question-desc {
    text-align: left;
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.stopbang-auto-answer {
    background: #f0f4f8;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
    font-size: 14px;
}

/* Results Screen */
.stopbang-results {
    text-align: center;
}

.stopbang-score-display {
    font-size: 72px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 30px 0;
}

.stopbang-severity-indicator {
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    font-size: 18px;
    font-weight: 500;
}

.severity-low {
    background: #d4edda;
    color: #155724;
}

.severity-moderate {
    background: #fff3cd;
    color: #856404;
}

.severity-high {
    background: #f8d7da;
    color: #721c24;
}

.stopbang-result-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
    line-height: 1.8;
}

/* Contact Section */
.stopbang-contact-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin: 20px 0;
}

.stopbang-action-buttons {
    margin-top: 30px;
}

/* Messages */
.stopbang-success-message {
    background: #4CAF50;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    animation: stopbangFadeIn 0.5s ease;
}

.stopbang-error-message {
    background: #f44336;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    animation: stopbangFadeIn 0.5s ease;
}

/* Honeypot */
.stopbang-honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    height: 0;
    width: 0;
    z-index: -1;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
}

/* reCAPTCHA Notice */
.stopbang-recaptcha-notice {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
}

.stopbang-recaptcha-notice a {
    color: #667eea;
    text-decoration: none;
}

.stopbang-recaptcha-notice a:hover {
    text-decoration: underline;
}

/* Loading State */
.stopbang-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: stopbangSpin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

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

/* Risk Badge */
.risk-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.risk-badge.risk-低度風險,
.risk-badge.risk-low-risk {
    background: #d4edda;
    color: #155724;
}

.risk-badge.risk-中度風險,
.risk-badge.risk-moderate-risk {
    background: #fff3cd;
    color: #856404;
}

.risk-badge.risk-高度風險,
.risk-badge.risk-high-risk {
    background: #f8d7da;
    color: #721c24;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stopbang-container {
        padding: 15px;
    }
    
    .stopbang-card {
        padding: 20px;
    }
    
    .stopbang-card h2 {
        font-size: 24px;
    }
    
    .stopbang-options-grid {
        grid-template-columns: 1fr;
    }
    
    .stopbang-input-group,
    .stopbang-location-group {
        grid-template-columns: 1fr;
    }
    
    .stopbang-score-display {
        font-size: 56px;
    }
    
    .stopbang-nav-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .stopbang-nav-buttons > div,
    .stopbang-nav-buttons > button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stopbang-card h2 {
        font-size: 20px;
    }
    
    .stopbang-card h3 {
        font-size: 18px;
    }
    
    .stopbang-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .stopbang-score-display {
        font-size: 48px;
    }
}

/* Print Styles */
@media print {
    .stopbang-btn,
    .stopbang-nav-buttons,
    .stopbang-contact-section {
        display: none !important;
    }
    
    .stopbang-container {
        max-width: 100%;
    }
    
    .stopbang-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}