/* Logo Styles - Hidden by main styles, kept for backward compat */
.app-logo {
    display: none !important;
}

.header-logo {
    display: none !important;
}

.chat-logo {
    display: none !important;
}

/* Tablet Optimizations (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .chat-sidebar {
        width: 250px;
    }
    
    .chat-right-panel {
        width: 250px;
    }
    
    .message {
        max-width: 75%;
    }
    
    #messageInput {
        font-size: 15px;
    }
}

/* Mobile Chat Improvements */
@media (max-width: 768px) {
    /* Hide sidebar on mobile */
    .chat-sidebar {
        display: none !important;
    }
    
    /* Make chat full width on mobile */
    .chat-main {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Mobile chat header */
    .chat-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 15px;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid rgba(124, 92, 252, 0.12);
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    .back-button-mobile {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #7C5CFC;
        cursor: pointer;
        padding: 5px 10px;
        display: flex;
        align-items: center;
        gap: 5px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .chat-header-info {
        display: flex;
        align-items: center;
        flex: 1;
        margin: 0 10px;
    }
    
    .chat-topic-mobile {
        display: flex;
        flex-direction: column;
        font-size: 0.85rem;
    }
    
    .topic-day-mobile {
        font-weight: 600;
        color: #7C5CFC;
        font-size: 0.75rem;
    }
    
    .topic-text-mobile {
        color: #6B5B8A;
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
    }
    
    /* Show back button on mobile */
    .back-button {
        display: flex !important;
        align-items: center;
        gap: 5px;
        background: none;
        border: none;
        font-size: 1.2rem;
        color: #7C5CFC;
        cursor: pointer;
        padding: 8px 12px;
        border-radius: 12px;
        transition: background-color 0.3s ease;
        min-width: 44px;
        min-height: 44px;
    }
    
    .back-button:active {
        background: rgba(124, 92, 252, 0.15);
    }
    
    .back-text {
        display: none;
    }
    
    .chat-layout {
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: -webkit-fill-available;
        position: fixed;
        width: 100%;
        top: 0;
        left: 0;
    }

    .chat-main {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .chat-messages {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 15px 10px;
        scroll-behavior: smooth;
    }

    .chat-input-container {
        position: sticky;
        bottom: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(16px);
        border-top: 1px solid rgba(124, 92, 252, 0.12);
        padding: 10px;
        box-sizing: border-box;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .chat-header {
        position: sticky;
        top: 0;
        width: 100%;
        z-index: 10;
        padding-top: max(10px, env(safe-area-inset-top));
    }
    
    .message {
        max-width: 85%;
        margin-bottom: 15px;
    }
    
    .message-content {
        padding: 12px 15px;
        font-size: 15px;
        line-height: 1.5;
    }
    
    .message-avatar {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    /* Mobile input area */
    .chat-input {
        padding: 10px;
        background: white;
        border-top: 1px solid rgba(124, 92, 252, 0.12);
    }
    
    .input-container {
        display: flex;
        gap: 8px;
    }
    
    .input-group {
        width: 100%;
        max-width: 100%;
    }
    
    #messageInput {
        flex: 1;
        padding: 12px;
        font-size: 16px;
        min-height: 44px;
        max-height: 120px;
        border-radius: 18px;
    }
    
    #sendButton, #voiceButton {
        min-width: 44px;
        min-height: 44px;
        height: 44px;
        width: 44px;
        padding: 0;
        flex-shrink: 0;
    }
    
    .send-button, .voice-button {
        min-width: 44px !important;
        min-height: 44px !important;
        width: 44px !important;
        height: 44px !important;
    }
    
    /* Icon buttons larger tap targets */
    .icon-button {
        min-width: 44px;
        min-height: 44px;
        font-size: 1.2rem;
    }
    
    /* TTS button */
    .tts-button {
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
        font-size: 1.1rem;
    }
}

/* Desktop styles */
@media (min-width: 769px) {
    .back-button-mobile {
        display: none;
    }
    
    .chat-topic-mobile {
        display: none;
    }
    
    .back-button {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 20px;
        background: linear-gradient(135deg, #FF6B8A, #7C5CFC);
        color: white;
        border: none;
        border-radius: 12px;
        cursor: pointer;
        font-size: 1rem;
        font-weight: 600;
        transition: all 0.3s ease;
        box-shadow: 0 4px 12px rgba(255, 107, 138, 0.25);
    }
    
    .back-text {
        display: inline;
    }
    
    .back-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(255, 107, 138, 0.35);
    }
}

/* Typing Indicator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 15px;
    background: rgba(124, 92, 252, 0.06);
    border-radius: 18px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #7C5CFC;
    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.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.koko-typing-text {
    font-size: 0.9rem;
    color: #7C5CFC;
    font-style: italic;
    margin-left: 10px;
}

/* Coffee Button Styles */
.coffee-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #FF6B8A 0%, #FFB347 100%);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 138, 0.3);
    margin-top: 10px;
}

.coffee-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 138, 0.4);
}

.coffee-button i {
    font-size: 1.1rem;
}

/* Coffee button in message bubble */
.message-coffee-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 107, 138, 0.08);
    color: #FF6B8A;
    text-decoration: none;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 8px;
    border: 1px solid rgba(255, 107, 138, 0.2);
}

.message-coffee-button:hover {
    background: rgba(255, 107, 138, 0.15);
    transform: scale(1.05);
}

/* Coffee section in pages */
.coffee-section {
    background: linear-gradient(135deg, #FFF0F3 0%, #F3E8FF 100%);
    padding: 20px;
    border-radius: 24px;
    text-align: center;
    margin: 20px 0;
    border: 2px solid #FF6B8A;
}

.coffee-section h3 {
    color: #FF6B8A;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.coffee-section p {
    color: #6B5B8A;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

/* Hide Grammar Assistant on mobile */
@media (max-width: 768px) {
    .chat-desktop-only {
        display: none !important;
    }
    
    .chat-right-panel {
        display: none !important;
    }
}

/* Show Grammar Assistant on desktop */
@media (min-width: 769px) {
    .chat-desktop-only {
        display: block;
    }
}
