/**
 * Coach4Life Chat Widget Styles
 * Version: 1.0.0
 * Fallback styles for browsers without Shadow DOM support
 */

/* Login Required Message */
.coach4life-login-required {
    max-width: 600px;
    padding: 40px;
    text-align: center;
    border: 2px solid #BFDBFE;
    border-radius: 12px;
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    margin: 40px auto;
}

.coach4life-login-required h3 {
    font-size: 24px;
    color: #1E40AF;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.coach4life-login-required p {
    font-size: 16px;
    color: #1f2937;
    margin-bottom: 24px;
    line-height: 1.6;
}

.coach4life-login-required .button {
    display: inline-block;
    padding: 12px 32px;
    background: #2563EB;
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s;
    font-size: 16px;
}

.coach4life-login-required .button:hover {
    background: #1E40AF;
}

/* Error Message */
.coach4life-error {
    padding: 16px 20px;
    background: #FEE2E2;
    border: 1px solid #FCA5A5;
    border-radius: 8px;
    color: #991B1B;
    margin: 20px 0;
    font-weight: 500;
}

/* Loading State */
.coach4life-loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(37, 99, 235, 0.3);
    border-radius: 50%;
    border-top-color: #2563EB;
    animation: coach4life-spin 0.8s linear infinite;
}

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

/* Chat Root Container */
#coach4life-chat-root {
    display: block;
    margin: 20px auto;
    width: 95%;
    max-width: 1200px;
}

/* Coaches Grid */
.coach4life-coaches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.coach4life-coach-card {
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.coach4life-coach-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.coach4life-coach-card .coach-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.coach4life-coach-card h3 {
    font-size: 20px;
    color: #1f2937;
    margin-bottom: 12px;
}

.coach4life-coach-card p {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 20px;
}

.coach4life-coach-card .button {
    display: inline-block;
    padding: 10px 24px;
    background: #2563EB;
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.2s;
}

.coach4life-coach-card .button:hover {
    background: #1E40AF;
}

/* Accessibility */
.coach4life-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus states for keyboard navigation */
.c4l-btn-icon:focus,
.c4l-input:focus,
.c4l-btn-send:focus {
    outline: 2px solid #2563EB;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .c4l-wrapper {
        border-width: 2px;
    }
    
    .c4l-message-content {
        border-width: 2px;
    }

    .coach4life-login-required,
    .coach4life-coach-card {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .c4l-message,
    .c4l-typing-dot,
    .coach4life-loading {
        animation: none;
    }

    .coach4life-coach-card {
        transition: none;
    }

    .coach4life-coach-card:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .c4l-input-area,
    .c4l-header-actions {
        display: none;
    }
    
    .c4l-wrapper {
        border: none;
        box-shadow: none;
        height: auto;
    }
    
    .c4l-messages {
        overflow: visible;
    }

    .coach4life-coach-card .button {
        display: none;
    }
}

/* Mobile optimization */
@media (max-width: 768px) {
    .coach4life-coaches-grid {
        grid-template-columns: 1fr;
    }

    .coach4life-login-required {
        margin: 20px;
        padding: 30px 20px;
    }
}

/* Dark mode support (if theme supports it) */
@media (prefers-color-scheme: dark) {
    .coach4life-login-required {
        background: linear-gradient(135deg, #1E3A8A 0%, #1E40AF 100%);
        border-color: #3B82F6;
    }

    .coach4life-login-required h3,
    .coach4life-login-required p {
        color: white;
    }

    .coach4life-coach-card {
        background: #1f2937;
        border-color: #374151;
    }

    .coach4life-coach-card h3 {
        color: white;
    }

    .coach4life-coach-card p {
        color: #d1d5db;
    }
}


/* ---------- Upgrade Banner (fallback) ---------- */
#c4l-upgrade-banner { display:none; padding: 12px 14px; border-bottom: 1px solid #e5e7eb; background: #ffffff; }
.c4l-upgrade-banner { border:1px solid #e5e7eb; background:#f9fafb; border-radius:12px; padding:12px 14px; font-size:14px; line-height:1.35; color:#111827; }
.c4l-hint { margin-top:6px; color:#4b5563; font-size:13px; }
#c4l-upgrade-modal { display:none; position:fixed; inset:0; z-index:9999; }
.c4l-modal-backdrop { position:absolute; inset:0; background: rgba(0,0,0,0.35); }
.c4l-modal { position:relative; width:calc(100% - 24px); max-width:480px; margin:12vh auto; background:#fff; padding:18px; border-radius:14px; box-shadow:0 20px 40px rgba(0,0,0,0.15); }
.c4l-modal-actions { display:flex; gap:10px; margin-top:14px; flex-wrap:wrap; }
.c4l-modal button { padding:10px 14px; border-radius:10px; border:none; cursor:pointer; flex:1; min-width:130px; }
.c4l-modal .primary { background:#111827; color:#fff; }
.c4l-modal .secondary { background:#f3f4f6; color:#111827; }
@media (max-height: 650px) { .c4l-modal { margin: 6vh auto; } }

/* ===== C4L_VOICE_BUTTON_COLORS_V1 ===== */
.c4l-voice-on  { background: #22c55e !important; border-color: #22c55e !important; color: #fff !important; }
.c4l-voice-off { background: #ef4444 !important; border-color: #ef4444 !important; color: #fff !important; }
/* ===== /C4L_VOICE_BUTTON_COLORS_V1 ===== */

/* ===== C4L_VOICE_BUTTON_COLORS_V2 ===== */
.c4l-voice-on  { background: #22c55e !important; border-color: #22c55e !important; color: #fff !important; }
.c4l-voice-off { background: #ef4444 !important; border-color: #ef4444 !important; color: #fff !important; }
/* ===== /C4L_VOICE_BUTTON_COLORS_V2 ===== */
