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

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    margin: 0 auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

/* Header */
.app-header {
    padding: 20px 20px 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo {
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.app-title {
    color: white;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.app-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 400;
    margin-top: 4px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

/* Language Selector */
.language-selector {
    margin-bottom: 30px;
    width: 100%;
    max-width: 280px;
}

.language-dropdown {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 16px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 48px;
}

.language-dropdown:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

/* Voice Container */
.voice-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* Status Display */
.status-display {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
}

.status-text {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.status-subtext {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 400;
}

/* Mic Section */
.mic-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.mic-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(145deg, #FF6B35, #F7931E);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(255, 107, 53, 0.4),
                inset 0 2px 8px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.mic-button:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(255, 107, 53, 0.5),
                inset 0 2px 8px rgba(255, 255, 255, 0.3);
}

.mic-button:active {
    transform: scale(0.95);
}

.mic-button.listening {
    animation: pulse 2s infinite;
    background: linear-gradient(145deg, #FF4757, #FF6B35);
}

.mic-icon {
    font-size: 40px;
    color: white;
    z-index: 2;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mic-pulse {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    opacity: 0;
    animation: pulse-ring 2s infinite;
}

.mic-button.listening .mic-pulse {
    opacity: 1;
}

.mic-label {
    color: white;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Query Display */
.query-display {
    width: 100%;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.4s ease-out;
}

.query-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.query-icon {
    color: #667eea;
    font-size: 18px;
}

.query-label {
    color: #333;
    font-weight: 600;
    font-size: 16px;
}

.query-text {
    color: #555;
    font-size: 16px;
    line-height: 1.5;
    padding-left: 28px;
}

/* Response Display */
.response-display {
    width: 100%;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.4s ease-out 0.2s both;
}

.response-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.response-icon {
    color: #FF6B35;
    font-size: 18px;
}

.response-label {
    color: #333;
    font-weight: 600;
    font-size: 16px;
    flex: 1;
}

.play-button {
    background: linear-gradient(145deg, #FF6B35, #F7931E);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.play-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
}

.play-button:active {
    transform: scale(0.95);
}

.play-button i {
    color: white;
    font-size: 14px;
    margin-left: 2px;
}

.play-button.playing i:before {
    content: "\f04c";
}

.response-text {
    color: #555;
    font-size: 16px;
    line-height: 1.6;
    padding-left: 28px;
}

/* Quick Actions */
.quick-actions {
    margin-top: 40px;
    width: 100%;
    max-width: 400px;
}

.quick-actions-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.quick-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.quick-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
}

.quick-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.quick-btn:active {
    transform: translateY(0);
}

.quick-btn i {
    font-size: 24px;
    color: #FFD700;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.quick-btn span {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Footer */
.app-footer {
    padding: 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: auto;
}

.footer-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    margin-bottom: 8px;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 11px;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: white;
}

.divider {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #FF6B35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.loading-text {
    font-size: 16px;
    font-weight: 500;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-up {
    animation: slideUp 0.4s ease-out;
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 8px 32px rgba(255, 107, 53, 0.4),
                    inset 0 2px 8px rgba(255, 255, 255, 0.2),
                    0 0 0 0 rgba(255, 107, 53, 0.7);
    }
    70% {
        box-shadow: 0 8px 32px rgba(255, 107, 53, 0.4),
                    inset 0 2px 8px rgba(255, 255, 255, 0.2),
                    0 0 0 20px rgba(255, 107, 53, 0);
    }
    100% {
        box-shadow: 0 8px 32px rgba(255, 107, 53, 0.4),
                    inset 0 2px 8px rgba(255, 255, 255, 0.2),
                    0 0 0 0 rgba(255, 107, 53, 0);
    }
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

/* Responsive Design */
@media (max-width: 480px) {
    .app-header {
        padding: 16px 16px 8px;
    }
    
    .app-title {
        font-size: 20px;
    }
    
    .app-subtitle {
        font-size: 13px;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .mic-button {
        width: 100px;
        height: 100px;
    }
    
    .mic-icon {
        font-size: 36px;
    }
    
    .status-text {
        font-size: 16px;
    }
    
    .quick-actions-title {
        font-size: 16px;
    }
    
    .query-display,
    .response-display {
        padding: 16px;
    }
    
    .query-text,
    .response-text {
        font-size: 15px;
    }
}

@media (max-width: 360px) {
    .quick-buttons {
        grid-template-columns: 1fr;
    }
    
    .mic-button {
        width: 90px;
        height: 90px;
    }
    
    .mic-icon {
        font-size: 32px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .query-display,
    .response-display {
        background: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.9);
    }
    
    .query-text,
    .response-text {
        color: rgba(255, 255, 255, 0.8);
    }
    
    .query-label,
    .response-label {
        color: rgba(255, 255, 255, 0.95);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .mic-button {
        border: 3px solid white;
    }
    
    .status-display {
        border: 2px solid rgba(255, 255, 255, 0.5);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .mic-button.listening {
        animation: none;
        background: linear-gradient(145deg, #FF4757, #FF6B35);
    }
    
    .mic-pulse {
        animation: none;
        opacity: 0.5;
    }
}