/* =============================================
   ELIGIBILITY PAGE STYLES
   Voice-first Conversational AI Interface
   ============================================= */

/* ========== PAGE LAYOUT ========== */
.eligibility-page {
    min-height: calc(100vh - 180px);
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    padding: 20px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* ========== CHAT CONTAINER ========== */
.chat-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(27, 94, 32, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 260px);
    min-height: 500px;
    max-height: 700px;
}

/* ========== CHAT HEADER ========== */
.chat-header {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.chat-title h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 2px 0;
}

.chat-title p {
    font-size: 0.8rem;
    opacity: 0.9;
    margin: 0;
}

.chat-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* ========== CHAT MESSAGES ========== */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8faf8;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: messageIn 0.3s ease;
}

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

.message.ai {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.message.ai .avatar {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light));
    color: white;
}

.message.user .avatar {
    background: #e0e0e0;
}

.message .content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message .bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.message.ai .bubble {
    background: white;
    color: var(--text-dark);
    border: 1px solid #e8e8e8;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.message.user .bubble {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    color: white;
    border-bottom-right-radius: 6px;
}

.message .time {
    font-size: 0.7rem;
    color: var(--text-light);
    padding: 0 4px;
}

.message.user .time {
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    border: 1px solid #e8e8e8;
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary-green);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* ========== INPUT AREA ========== */
.input-area {
    background: white;
    border-top: 1px solid #e8e8e8;
    padding: 12px 20px 15px;
    position: relative;
}

/* Toggle Switch - Top Left */
.input-mode-toggle {
    position: absolute;
    top: 10px;
    left: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.toggle-option {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s;
    opacity: 0.5;
}

.toggle-option:hover {
    opacity: 0.8;
}

.toggle-option.active {
    opacity: 1;
    background: rgba(27, 94, 32, 0.1);
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: background 0.3s;
}

.toggle-switch.voice-mode {
    background: var(--primary-green);
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.voice-mode .toggle-slider {
    transform: translateX(20px);
}

/* ========== VOICE SECTION ========== */
.voice-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px 0 5px;
}

/* Voice Visualizer */
.voice-visualizer {
    flex: 1;
    max-width: 180px;
    height: 36px;
    display: flex;
    align-items: center;
    opacity: 0.25;
    transition: opacity 0.3s;
}

.voice-visualizer.left {
    justify-content: flex-end;
}

.voice-visualizer.right {
    justify-content: flex-start;
}

.voice-visualizer.active {
    opacity: 1;
}

.visualizer-bars {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 100%;
}

.visualizer-bars span {
    width: 4px;
    height: 6px;
    background: linear-gradient(180deg, var(--primary-green), var(--accent-green));
    border-radius: 2px;
    transition: height 0.08s ease;
}

.voice-visualizer.active .visualizer-bars span {
    animation: visualize 0.5s ease-in-out infinite;
}

.visualizer-bars span:nth-child(1) { animation-delay: 0.0s; }
.visualizer-bars span:nth-child(2) { animation-delay: 0.05s; }
.visualizer-bars span:nth-child(3) { animation-delay: 0.1s; }
.visualizer-bars span:nth-child(4) { animation-delay: 0.15s; }
.visualizer-bars span:nth-child(5) { animation-delay: 0.2s; }
.visualizer-bars span:nth-child(6) { animation-delay: 0.25s; }
.visualizer-bars span:nth-child(7) { animation-delay: 0.3s; }
.visualizer-bars span:nth-child(8) { animation-delay: 0.35s; }
.visualizer-bars span:nth-child(9) { animation-delay: 0.4s; }
.visualizer-bars span:nth-child(10) { animation-delay: 0.45s; }
.visualizer-bars span:nth-child(11) { animation-delay: 0.4s; }
.visualizer-bars span:nth-child(12) { animation-delay: 0.35s; }
.visualizer-bars span:nth-child(13) { animation-delay: 0.3s; }
.visualizer-bars span:nth-child(14) { animation-delay: 0.25s; }
.visualizer-bars span:nth-child(15) { animation-delay: 0.2s; }
.visualizer-bars span:nth-child(16) { animation-delay: 0.15s; }
.visualizer-bars span:nth-child(17) { animation-delay: 0.1s; }
.visualizer-bars span:nth-child(18) { animation-delay: 0.05s; }
.visualizer-bars span:nth-child(19) { animation-delay: 0.0s; }
.visualizer-bars span:nth-child(20) { animation-delay: 0.05s; }

@keyframes visualize {
    0%, 100% { 
        height: 6px; 
        background: linear-gradient(180deg, var(--primary-green), var(--accent-green));
    }
    50% { 
        height: 30px; 
        background: linear-gradient(180deg, #FF6B35, #FF9933);
    }
}

/* Voice Button */
.voice-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    border: none;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(27, 94, 32, 0.25);
    flex-shrink: 0;
}

.voice-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(27, 94, 32, 0.35);
}

.voice-btn:active {
    transform: scale(0.98);
}

.voice-btn .mic-icon {
    font-size: 1.4rem;
    z-index: 2;
}

.voice-btn.recording {
    background: linear-gradient(135deg, #C62828, #E53935);
    animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {
    0%, 100% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(198, 40, 40, 0); }
}

/* Recording Ring Animation */
.recording-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid transparent;
    opacity: 0;
    transition: opacity 0.3s;
}

.voice-btn.recording .recording-ring {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.5);
    animation: ring-pulse 1s infinite;
}

@keyframes ring-pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* ========== TEXT SECTION ========== */
.text-section {
    width: 100%;
    padding: 30px 0 5px;
}

.text-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f5;
    border-radius: 30px;
    padding: 5px 5px 5px 18px;
    border: 2px solid transparent;
    transition: border-color 0.3s, background 0.3s;
}

.text-input-wrapper:focus-within {
    background: white;
    border-color: var(--primary-green);
}

.text-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    outline: none;
    padding: 8px 0;
}

.text-input-wrapper input::placeholder {
    color: #999;
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(27, 94, 32, 0.3);
}

/* ========== UTILITY CLASSES ========== */
.hidden {
    display: none !important;
}

/* ========== SCROLLBAR ========== */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c8c8c8;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 768px) {
    .eligibility-page {
        padding: 15px 10px;
    }
    
    .chat-container {
        height: calc(100vh - 220px);
        min-height: 450px;
        border-radius: 16px;
    }
    
    .chat-header {
        padding: 14px 16px;
    }
    
    .chat-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
    
    .chat-title h3 {
        font-size: 1rem;
    }
    
    .chat-messages {
        padding: 15px;
        gap: 14px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .message .bubble {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
    
    .input-area {
        padding: 10px 15px 12px;
    }
    
    .input-mode-toggle {
        top: 8px;
        left: 12px;
        gap: 4px;
    }
    
    .toggle-option {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .toggle-switch {
        width: 40px;
        height: 22px;
    }
    
    .toggle-slider {
        width: 18px;
        height: 18px;
    }
    
    .toggle-switch.voice-mode .toggle-slider {
        transform: translateX(18px);
    }
    
    .voice-section {
        gap: 10px;
        padding: 28px 0 5px;
    }
    
    .text-section {
        padding: 28px 0 5px;
    }
    
    .voice-btn {
        width: 45px;
        height: 45px;
    }
    
    .voice-btn .mic-icon {
        font-size: 1.2rem;
    }
    
    .voice-visualizer {
        max-width: 120px;
        height: 32px;
    }
    
    .visualizer-bars span {
        width: 3px;
    }
}

@media (max-width: 400px) {
    .chat-container {
        border-radius: 12px;
    }
    
    .chat-header {
        padding: 12px 14px;
        gap: 10px;
    }
    
    .chat-avatar {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    .message .avatar {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
    
    .voice-section {
        gap: 8px;
    }
    
    .voice-btn {
        width: 42px;
        height: 42px;
    }
    
    .voice-visualizer {
        max-width: 80px;
    }
    
    .visualizer-bars span {
        width: 2px;
        gap: 2px;
    }
}
