/* Enhanced Styles for Desktop and Mobile - styles-enhanced.css */

/* Desktop adjustments for smaller avatar and bigger chat */
.avatar-section {
    margin-bottom: 20px;
}

.avatar-container {
    width: 100px;
    height: 100px;
}

.avatar-circle {
    width: 100px;
    height: 100px;
}

.avatar-glow {
    width: 140px;
    height: 140px;
}

.avatar-icon svg {
    width: 40px;
    height: 40px;
}

.assistant-name {
    font-size: 20px;
    margin-bottom: 4px;
}

.assistant-status {
    font-size: 14px;
}

.main-content {
    padding: 20px 20px;
}

.chat-section {
    max-width: 900px;
    height: calc(100vh - 300px);
    margin-bottom: 20px;
}

.talk-button {
    width: 100px;
    height: 100px;
}

.mic-icon {
    width: 24px;
    height: 24px;
}

.button-text {
    font-size: 13px;
}

/* Enhanced Mobile Styles */
@media (max-width: 768px) {
    /* Prevent zoom on input focus */
    input, textarea, button {
        font-size: 16px !important;
    }
    
    /* Mobile-optimized container */
    .container {
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
    }
    
    /* Simplified mobile header */
    .header {
        padding: 12px 16px;
        background: rgba(0, 0, 0, 0.95);
    }
    
    .logo span {
        display: none;
    }
    
    .connection-status {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .status-text {
        display: none;
    }
    
    .connection-status.connected .status-dot {
        width: 10px;
        height: 10px;
    }
    
    .end-session-btn {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 20px;
    }
    
    /* Compact avatar section for mobile */
    .main-content {
        padding: 15px 10px 10px;
        display: flex;
        flex-direction: column;
        height: calc(100vh - 60px);
        height: calc(100dvh - 60px);
    }
    
    .avatar-section {
        margin-bottom: 15px;
        flex-shrink: 0;
    }
    
    .avatar-container {
        width: 60px;
        height: 60px;
    }
    
    .avatar-circle {
        width: 60px;
        height: 60px;
    }
    
    .avatar-glow {
        width: 80px;
        height: 80px;
    }
    
    .avatar-icon svg {
        width: 30px;
        height: 30px;
    }
    
    .assistant-name {
        font-size: 16px;
        margin-bottom: 2px;
    }
    
    .assistant-status {
        font-size: 12px;
    }
    
    /* Optimized chat section for mobile */
    .chat-section {
        flex: 1;
        margin: 0 10px;
        padding: 16px;
        border-radius: 20px;
        min-height: 0; /* Important for flex children */
        display: flex;
        flex-direction: column;
        margin-bottom: 90px; /* Space for mic button */
        height: auto;
    }
    
    .chat-container {
        flex: 1;
        min-height: 0; /* Allow proper scrolling */
    }
    
    .messages-area {
        padding-right: 5px;
        padding-bottom: 20px;
    }
    
    /* Larger, more readable messages on mobile */
    .message {
        margin-bottom: 16px;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .message-text {
        font-size: 16px;
        line-height: 1.6;
        padding: 12px 16px;
        border-radius: 16px;
    }
    
    /* Fixed position mic button for mobile */
    .talk-button {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 70px;
        height: 70px;
        z-index: 100;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    }
    
    .mic-icon {
        width: 22px;
        height: 22px;
    }
    
    .button-text {
        font-size: 10px;
        margin-top: 2px;
    }
    
    /* Mobile-optimized feedback */
    .message-feedback-toggle {
        padding: 6px 10px;
        font-size: 11px;
        bottom: -10px;
    }
    
    .message-feedback {
        margin-top: 12px;
        padding: 12px;
        margin-left: 0;
        margin-right: 0;
    }
    
    .feedback-sections-compact {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .feedback-section-compact {
        padding: 10px;
    }
    
    .section-title {
        font-size: 13px;
    }
    
    .section-score {
        font-size: 15px;
    }
    
    .feedback-text-display {
        font-size: 15px;
        line-height: 1.6;
        padding: 10px;
    }
    
    /* Touch-friendly tap targets */
    button, .talk-button {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Prevent text selection on buttons */
    .talk-button {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Loading states more visible on mobile */
    .feedback-loading {
        padding: 24px;
    }
    
    .loader-text {
        font-size: 14px;
    }
    
    /* Adjust sound waves for smaller avatar */
    .sound-waves {
        bottom: -30px;
    }
    
    .sound-waves span {
        width: 2px;
        height: 15px;
    }
    
    @keyframes wave {
        0%, 100% { height: 15px; }
        50% { height: 25px; }
    }
}

/* Small phones (iPhone SE, etc.) */
@media (max-width: 375px) {
    .chat-section {
        margin: 0 8px;
        padding: 12px;
    }
    
    .message-text {
        font-size: 15px;
        padding: 10px 14px;
    }
    
    .talk-button {
        width: 65px;
        height: 65px;
        bottom: 15px;
    }
    
    .avatar-container {
        width: 50px;
        height: 50px;
    }
    
    .avatar-circle {
        width: 50px;
        height: 50px;
    }
    
    .avatar-icon svg {
        width: 25px;
        height: 25px;
    }
    
    .assistant-name {
        font-size: 15px;
    }
    
    .assistant-status {
        font-size: 11px;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .avatar-section {
        display: none;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .chat-section {
        margin-bottom: 80px;
    }
    
    .talk-button {
        width: 60px;
        height: 60px;
        bottom: 10px;
    }
    
    .button-text {
        display: none;
    }
}

/* iOS-specific fixes */
@supports (-webkit-touch-callout: none) {
    .talk-button {
        -webkit-touch-callout: none;
    }
    
    /* Fix for iOS Safari bottom bar */
    .container {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Android-specific fixes */
@media (hover: none) and (pointer: coarse) {
    .talk-button:active {
        transform: translateX(-50%) scale(0.95);
    }
}