/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
    color: #1e293b;
    overflow-x: hidden;
}

/* Screens */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* Loading Screen */
.loading-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 60px 20px;
}

.pulse {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-radius: 50%;
    margin: 0 auto 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
}

.pulse i {
    font-size: 50px;
    color: white;
}

.loading-container h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #2563eb, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.2rem;
    color: #64748b;
    margin-bottom: 40px;
}

.features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.feature:hover {
    transform: translateY(-5px);
}

.feature i {
    font-size: 24px;
    color: #2563eb;
}

.feature span {
    font-weight: 600;
    color: #334155;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

/* Language Selection */
.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.language-card {
    background: white;
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid #e2e8f0;
}

.language-card:hover {
    transform: translateY(-5px);
    border-color: #2563eb;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.1);
}

.language-card.selected {
    border-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.flag {
    font-size: 40px;
    margin-bottom: 15px;
}

.language-card h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #1e293b;
}

.language-card p {
    color: #64748b;
    font-size: 0.9rem;
}

/* Assistant Screen */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.icon-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.icon-btn:hover {
    background: #e2e8f0;
    transform: scale(1.1);
}

.current-language {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #eff6ff;
    padding: 8px 16px;
    border-radius: 20px;
}

.lang-indicator {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    animation: blink 2s infinite;
}

.progress-container {
    margin-top: 20px;
}

.progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: 20%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    transition: width 0.5s;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.step {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #94a3b8;
}

.step.active {
    background: #2563eb;
    color: white;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

/* Chat Container */
.chat-container {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.assistant-message {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar i {
    font-size: 24px;
    color: white;
}

.message {
    background: #f8fafc;
    padding: 20px;
    border-radius: 18px;
    border-top-left-radius: 0;
    max-width: 80%;
}

.message p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #334155;
}

.timestamp {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 8px;
}

/* Microphone Button */
.mic-container {
    text-align: center;
    margin: 40px 0;
}

.mic-btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
}

.mic-btn:hover {
    transform: scale(1.1);
}

.mic-btn.listening {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    animation: pulse 1s infinite;
}

.mic-btn i {
    font-size: 40px;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid #2563eb;
    border-radius: 50%;
    animation: pulse-ring 2s infinite;
}

.mic-label {
    margin-top: 15px;
    font-weight: 500;
    color: #475569;
}

.voice-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 8px 16px;
    border-radius: 20px;
    margin-top: 10px;
    font-size: 0.9rem;
}

.voice-status i {
    color: #10b981;
    animation: blink 2s infinite;
}

/* Transcription */
.transcription {
    margin-top: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
}

.transcription h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #334155;
}

.transcript-box {
    height: 120px;
    background: white;
    border-radius: 8px;
    padding: 15px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Receipt Screen */
.receipt-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
    margin: 30px 0;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
}

.hospital-logo {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-radius: 16px;
    color: white;
    margin-bottom: 25px;
}

.hospital-logo i {
    font-size: 50px;
    margin-bottom: 15px;
}

.hospital-logo h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-row:last-child {
    border-bottom: none;
}

.label {
    color: #64748b;
    font-weight: 500;
}

.value {
    color: #1e293b;
    font-weight: 600;
}

/* Urgency Badge */
.urgency-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.urgency-badge.low {
    background: #d1fae5;
    color: #065f46;
}

.urgency-badge.medium {
    background: #fef3c7;
    color: #92400e;
}

.urgency-badge.high {
    background: #fee2e2;
    color: #991b1b;
    animation: pulse 1.5s infinite;
}

/* Department Display */
.department-display {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #eff6ff;
    border-radius: 12px;
    margin-top: 15px;
}

.department-display i {
    font-size: 40px;
    color: #2563eb;
}

/* Doctors List */
.doctors-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.doctor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid #2563eb;
}

.doctor-name {
    font-weight: 600;
    color: #1e293b;
}

.doctor-availability {
    font-size: 0.9rem;
    color: #64748b;
}

/* Disclaimer */
.disclaimer {
    background: #fef3c7;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #f59e0b;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #92400e;
}

.disclaimer i {
    color: #f59e0b;
    margin-right: 10px;
}

/* JSON Output */
.json-output {
    margin-top: 40px;
}

.json-output pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 25px;
    border-radius: 12px;
    overflow-x: auto;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Controls */
.controls {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.receipt-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

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

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(37, 99, 235, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

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

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Responsive */
@media (max-width: 768px) {
    .receipt-container {
        grid-template-columns: 1fr;
    }
    
    .language-grid {
        grid-template-columns: 1fr;
    }
    
    .features {
        flex-direction: column;
        align-items: center;
    }
    
    .message {
        max-width: 100%;
    }
}