/**
 * GlideSafeApp Styles
 * Mobile-first, card-based, clean aviation-style UI.
 */

.glidesafe-app-container {
    max-width: 600px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    line-height: 1.5;
    box-sizing: border-box;
}

.glidesafe-app-container * {
    box-sizing: border-box;
}

.glidesafe-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.glidesafe-header {
    background: #1e293b;
    /* Slate 800 */
    color: #fff;
    padding: 16px 20px;
}

.glidesafe-header h2,
.glidesafe-header h3 {
    margin: 0;
    font-weight: 600;
    color: #fff;
}

.glidesafe-header h2 {
    font-size: 1.25rem;
}

.glidesafe-header h3 {
    font-size: 1.1rem;
    margin-top: 4px;
}

.glidesafe-step-indicator {
    font-size: 0.8rem;
    color: #94a3b8;
    /* Slate 400 */
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.glidesafe-body {
    padding: 20px;
}

.glidesafe-footer {
    padding: 16px 20px;
    background: #f8fafc;
    /* Slate 50 */
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

/* Button Styles */
.glidesafe-btn {
    appearance: none;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    flex: 1;
    text-align: center;
}

.glidesafe-btn:active {
    transform: scale(0.98);
}

.glidesafe-btn-primary {
    background: #2563eb;
    /* Blue 600 */
    color: #fff;
}

.glidesafe-btn-primary:hover {
    background: #1d4ed8;
}

.glidesafe-btn-primary:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

.glidesafe-btn-secondary {
    background: #e2e8f0;
    /* Slate 200 */
    color: #475569;
    /* Slate 600 */
}

.glidesafe-btn-secondary:hover {
    background: #cbd5e1;
}

/* Form Elements */
.glidesafe-question-group {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.glidesafe-question-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.glidesafe-question-text {
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.05rem;
}

.glidesafe-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.glidesafe-radio-label {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.glidesafe-radio-label:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.glidesafe-radio-label input[type="radio"] {
    display: none;
}

.glidesafe-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    margin-right: 12px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.glidesafe-radio-label input[type="radio"]:checked+.glidesafe-radio-custom {
    border-color: #2563eb;
}

.glidesafe-radio-label input[type="radio"]:checked+.glidesafe-radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #2563eb;
    border-radius: 50%;
}

.glidesafe-radio-label:has(input[type="radio"]:checked) {
    border-color: #2563eb;
    background: #eff6ff;
    /* Blue 50 */
}

/* Loading Spinner */
.glidesafe-center {
    text-align: center;
    padding: 40px 20px;
}

.glidesafe-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: glidesafe-spin 1s linear infinite;
    margin: 0 auto 16px auto;
}

@keyframes glidesafe-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Result View */
.glidesafe-traffic-light {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: #333;
    padding: 16px;
    border-radius: 12px;
    width: 80px;
    margin: 0 auto 24px auto;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.glidesafe-light {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #111;
    opacity: 0.3;
    transition: opacity 0.5s, box-shadow 0.5s;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.glidesafe-light-red {
    background: #ef4444;
}

.glidesafe-light-yellow {
    background: #f59e0b;
}

.glidesafe-light-green {
    background: #10b981;
}

.glidesafe-light.active {
    opacity: 1;
}

.glidesafe-light-red.active {
    box-shadow: 0 0 20px #ef4444, inset 0 0 10px rgba(255, 255, 255, 0.5);
}

.glidesafe-light-yellow.active {
    box-shadow: 0 0 20px #f59e0b, inset 0 0 10px rgba(255, 255, 255, 0.5);
}

.glidesafe-light-green.active {
    box-shadow: 0 0 20px #10b981, inset 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Horizontal traffic light on larger screens for compactness */
@media (min-width: 400px) {
    .glidesafe-traffic-light {
        flex-direction: row;
        width: auto;
        justify-content: center;
    }
}

.glidesafe-result-details {
    text-align: center;
    margin-bottom: 24px;
}

.glidesafe-result-details h3 {
    font-size: 1.5rem;
    margin: 0 0 8px 0;
}

.glidesafe-result-message {
    font-size: 1.1rem;
    color: #475569;
    margin-bottom: 20px;
}

.glidesafe-score-box,
.glidesafe-top-driver-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.glidesafe-score-box span,
.glidesafe-top-driver-box span {
    color: #64748b;
    font-weight: 500;
}

.glidesafe-score-box strong,
.glidesafe-top-driver-box strong {
    font-size: 1.2rem;
    color: #0f172a;
}

/* Step visibility */
.glidesafe-step {
    display: none;
}

/* DHV Search Components */
.glidesafe-search-container {
    position: relative;
    width: 100%;
}

.gs-dhv-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.2s;
}

.gs-dhv-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.gs-dhv-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.gs-dhv-result-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.gs-dhv-result-item:last-child {
    border-bottom: none;
}

.gs-dhv-result-item:hover,
.gs-dhv-result-item.active {
    background: #f8fafc;
}

.gs-dhv-result-title {
    font-weight: 600;
    color: #1e293b;
    display: block;
}

.gs-dhv-result-meta {
    font-size: 0.85rem;
    color: #64748b;
    display: block;
    margin-top: 2px;
}

.gs-dhv-info-box {
    margin-top: 20px;
    padding: 16px;
    background: #f0fdf4;
    /* emerald-50 */
    border: 1px solid #86efac;
    /* emerald-300 */
    border-radius: 6px;
}

.gs-dhv-info-box h4 {
    margin: 0 0 10px 0;
    color: #065f46;
    /* emerald-800 */
    font-size: 1.1rem;
}

.gs-dhv-info-box p {
    margin: 4px 0;
    font-size: 0.95rem;
    color: #064e3b;
    /* emerald-900 */
}