/* Web 3.0 Fluid Design with Better Contrast */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100dvh;
	height: -webkit-fill-available; /* Fallback */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #ffffff;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(71, 85, 105, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

header {
    text-align: center;
    margin-bottom: 32px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    font-size: 1.1rem;
    color: #94a3b8;
}

.card {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 20px;
    border: 2px solid rgba(59, 130, 246, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

#voice-chat-container.card {
    background: linear-gradient(135deg, #0c1426 0%, #1e293b 100%);
    border: 2px solid rgba(34, 197, 94, 0.2);
}

.hidden {
    display: none !important;
}

/* WhatsApp Instructions */
.whatsapp-instructions {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    padding: 24px;
    border-radius: 16px;
    margin: 24px 0;
    border-left: 4px solid #60a5fa;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

.whatsapp-instructions p {
    margin-bottom: 16px;
    line-height: 1.6;
}

.whatsapp-instructions p:last-child {
    margin-bottom: 0;
}

/* Title standalone row */
.app-title-standalone {
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 24px 0;
    text-align: center;
    line-height: 1.2;
}

/* Action buttons row - right justified */
.action-buttons-row {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 24px;
}

.header-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.header-btn.donate {
    background-color: #ef4444;
    background-image: url('/images/donate.png');
}

.header-btn.feedback {
    background-color: #3b82f6;
    background-image: url('/images/feedback.png');
}

.header-btn:hover {
    transform: scale(1.05);
}

/* Status message bar */
.status-message-bar {
    background: rgba(15, 23, 42, 0.6);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    text-align: center;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-message-bar #voice-status {
    font-size: 16px;
    color: #e2e8f0;
    font-weight: 500;
    margin: 0;
}

/* Voice controls - all same size */
.voice-controls-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}

.voice-btn {
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 24px;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.voice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Original mic button styles */
.icon-btn {
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 24px;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.icon-btn.mic.unmuted {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.icon-btn.mic.muted {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.icon-btn.mic.processing {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.icon-btn.mic.disabled {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    opacity: 0.6;
}

.icon-btn.mic.unmuted .mic-off-icon {
    display: none;
}

.icon-btn.mic.muted .mic-on-icon {
    display: none;
}

.icon-btn.mic.processing .mic-off-icon {
    display: none;
}

.icon-btn.mic.disabled .mic-off-icon {
    display: none;
}

/* Reset button */
.reset-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    display: none;
}

.reset-btn.show {
    display: flex;
}

/* Hangup button */
.hangup-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.spacer {
    height: 12px;
}

/* Conversation History */
.conversation-compact {
    margin-top: 0;
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.conversation-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    padding: 12px 16px;
    font-weight: 600;
    text-align: center;
    font-size: 14px;
}

.messages-compact {
    height: 180px;
    overflow-y: auto;
    padding: 12px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.messages-compact .message {
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    animation: fadeIn 0.4s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.messages-compact .message.user {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    border-left: 3px solid #3b82f6;
}

.messages-compact .message.ai {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    border-left: 3px solid #a855f7;
}

.messages-compact .message-header {
    font-size: 11px;
    margin-bottom: 4px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
}

.messages-compact .message-time {
    font-size: 10px;
    color: #cbd5e1;
}

.messages-compact .message-content {
    line-height: 1.6;
    color: #f1f5f9;
}

/* Form Styles */
.form-group {
    margin-bottom: 28px;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #f1f5f9;
    font-size: 16px;
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.5;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 18px 20px;
    border: 2px solid rgba(100, 116, 139, 0.3);
    border-radius: 12px;
    font-size: 16px;
    background: rgba(15, 23, 42, 0.8);
    color: #f1f5f9;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    background: rgba(30, 41, 59, 0.9);
}

.form-group input::placeholder {
    color: #64748b;
}

.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 8px 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Auth Container Titles */
#auth-container h1.app-title {
    margin-bottom: 40px;
    font-size: 2.2rem;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#auth-container h3 {
    margin-bottom: 32px;
    color: #ffffff;
    font-size: 1.5rem;
}

/* Error message */
.error-message {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    border-left: 4px solid #f87171;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 20px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    border: 2px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    position: relative;
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: #ffffff;
}

.modal h3 {
    color: #ffffff;
    margin-bottom: 24px;
    text-align: center;
    font-size: 1.5rem;
}

.donate-details {
    display: grid;
    gap: 24px;
}

.bank-details, .upi-details {
    background: rgba(15, 23, 42, 0.8);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.bank-details h4, .upi-details h4 {
    color: #22c55e;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.bank-details p, .upi-details p {
    color: #e2e8f0;
    margin-bottom: 8px;
    line-height: 1.5;
}

.qr-placeholder {
    width: 120px;
    height: 120px;
    background: #475569;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    margin: 12px auto;
}

#feedback-text {
    width: 100%;
    padding: 16px;
    border: 2px solid rgba(100, 116, 139, 0.3);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.8);
    color: #f1f5f9;
    font-size: 16px;
    resize: vertical;
    margin-bottom: 20px;
}

#feedback-text:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-buttons .btn {
    margin: 0;
}

/* Flash Messages */
.flash-message {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.flash-message.show {
    opacity: 1;
    transform: translateX(0);
}

.flash-message.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.flash-message.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.flash-message.info {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.mute-chip {
    position: fixed;
    top: 24px;
    left: 24px;
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Safari zoom prevention */
input[type="tel"], input[type="text"], input[type="number"], select, textarea {
    font-size: 16px !important;
}

/* Touch improvements */
.btn, .voice-btn, .header-btn {
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        margin: 12px;
        padding: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 24px;
    }
    
    .form-group input, .form-group select {
        padding: 16px;
    }
    
    .btn {
        padding: 14px 24px;
    }
    
    .app-title-standalone {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    
    .action-buttons-row {
        margin-bottom: 20px;
    }
    
    .header-btn {
        width: 44px;
        height: 44px;
    }
    
    .status-message-bar {
        padding: 14px;
        margin-bottom: 20px;
    }
    
    .status-message-bar #voice-status {
        font-size: 15px;
    }
    
    .voice-controls-row {
        gap: 16px;
        margin-bottom: 20px;
    }
    
    .voice-btn {
        width: 60px;
        height: 60px;
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .messages-compact {
        height: 160px;
        padding: 10px;
    }
    
    .messages-compact .message {
        margin-bottom: 8px;
        padding: 10px;
        font-size: 12px;
    }
    
    .messages-compact .message-header {
        font-size: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
        padding: 20px 16px;
    }
    
    .whatsapp-instructions {
        padding: 16px;
        margin: 16px 0;
    }
}



/* Fix reset button */
.reset-btn i {
    font-size: 20px;
}

.reset-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
}

.header-btn.install {
    background-color: #22c55e;
    color: white;
    font-size: 16px;
}

.header-btn.install:hover {
    background-color: #16a34a;
}

.phone-input-group {
    display: flex;
    gap: 8px;
}

#country-code {
    width: 100px;
    flex-shrink: 0;
}

#phone {
    flex: 1;
}

.upi-details img {
    max-width: 250px;
    height: auto;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: white;
}

button, input, select {
    touch-action: manipulation;
}

.channel-options {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    justify-content: center;
}

.channel-option {
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}

.channel-option:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.channel-option input[type="radio"] {
    display: none;
}

.channel-option input[type="radio"]:checked + span {
    color: #3b82f6;
    font-weight: bold;
}