/* Poppins Font Import */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    color: #e2e8f0;
    min-height: 100vh;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    z-index: 1000;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.nav-logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

.nav-btn:hover {
    background: rgba(100, 116, 139, 0.2);
    color: #e2e8f0;
}

.nav-btn.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.mobile-menu-btn {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    z-index: 999;
    flex-direction: column;
    gap: 10px;
}

.mobile-menu .nav-btn {
    width: 100%;
    text-align: left;
}

/* Sections */
.section {
    display: none;
    min-height: 100vh;
    padding-top: 80px;
}

.section.active {
    display: block;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.6s ease;
}

.section-header h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    font-size: 1.2rem;
    color: #94a3b8;
}

/* AI Tabs */
.ai-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background: rgba(100, 116, 139, 0.3);
    color: #e2e8f0;
}

.tab-btn.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.tab-content.active {
    display: block;
}

/* Chat Interface */
.chat-container {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: fadeInUp 0.3s ease;
}

.message.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.user-message .message-avatar {
    background: rgba(100, 116, 139, 0.5);
}

.message-content {
    background: rgba(51, 65, 85, 0.5);
    border-radius: 16px;
    padding: 12px 16px;
    max-width: 70%;
}

.user-message .message-content {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.chat-input-container {
    display: flex;
    padding: 20px;
    gap: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

#chatInput {
    flex: 1;
    padding: 12px 16px;
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    color: #e2e8f0;
    font-family: 'Poppins', sans-serif;
}

#chatInput::placeholder {
    color: #64748b;
}

#sendBtn {
    padding: 12px 16px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

#sendBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

/* Voice Interface */
.voice-container {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    padding: 40px;
}

.voice-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px;
    transition: all 0.3s ease;
}

.voice-icon.listening {
    animation: pulse 2s infinite;
    transform: scale(1.1);
}

.voice-container h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.voice-container p {
    color: #94a3b8;
    margin-bottom: 2rem;
}

.voice-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 2rem;
}

.voice-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

.voice-btn.stop {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.voice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.voice-transcript {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    padding: 16px;
    margin-top: 20px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

/* Image Generation */
.image-container {
    max-width: 600px;
    margin: 0 auto;
}

.image-container h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

#imagePrompt {
    width: 100%;
    height: 120px;
    padding: 16px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    color: #e2e8f0;
    font-family: 'Poppins', sans-serif;
    resize: vertical;
    margin-bottom: 20px;
}

#imagePrompt::placeholder {
    color: #64748b;
}

.generate-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    margin-bottom: 20px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.generated-image {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.1);
    min-height: 100px;
}

.generated-image img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Library */
.search-container {
    display: flex;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto 3rem;
}

#bookSearch {
    flex: 1;
    padding: 12px 16px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    color: #e2e8f0;
    font-family: 'Poppins', sans-serif;
}

#bookSearch::placeholder {
    color: #64748b;
}

#searchBtn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

#searchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.3);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.book-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(6, 182, 212, 0.1);
}

.book-cover {
    width: 100%;
    height: 300px;
    background: rgba(51, 65, 85, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-info {
    padding: 16px;
}

.book-title {
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.book-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.subject-tag {
    background: rgba(6, 182, 212, 0.2);
    color: #06b6d4;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
}

.read-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

.read-btn:hover {
    background: linear-gradient(135deg, #0891b2, #0e7490);
}

.loading {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-size: 1.1rem;
}

/* Developer Section */
.developer-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    animation: fadeInUp 0.6s ease;
}

.developer-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    margin: 0 auto 20px;
}

.developer-card h3 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.developer-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.badge.age {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: white;
}

.badge.role {
    background: rgba(6, 182, 212, 0.2);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.skills-section, .contact-section, .availability-section {
    margin-bottom: 40px;
}

.skills-section h4, .contact-section h4 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.skill-card {
    background: rgba(51, 65, 85, 0.3);
    border-radius: 12px;
    padding: 24px;
    text-align: left;
}

.skill-icon {
    font-size: 24px;
    margin-bottom: 12px;
}

.skill-card h5 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.skill-card p {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.5;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.contact-card {
    background: rgba(51, 65, 85, 0.3);
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.contact-card:hover {
    transform: translateY(-4px);
    border-color: rgba(148, 163, 184, 0.2);
}

.contact-card.whatsapp:hover {
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.1);
}

.contact-card.telegram:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.1);
}

.contact-card.email:hover {
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.1);
}

.contact-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.contact-card h5 {
    margin-bottom: 4px;
}

.contact-card p {
    font-size: 0.9rem;
    color: #94a3b8;
}

.availability-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 24px;
}

.availability-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.availability-card h5 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #c084fc;
}

.availability-card p {
    color: #94a3b8;
    line-height: 1.5;
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-menu {
        display: none;
    }
    
    .section-header h2 {
        font-size: 2.5rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    .ai-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .tab-btn {
        width: 200px;
    }
    
    .chat-messages {
        height: 300px;
    }
    
    .voice-container {
        padding: 20px;
    }
    
    .voice-icon {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
    
    .voice-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .voice-btn {
        width: 200px;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .developer-card {
        padding: 20px;
    }
    
    .developer-card h3 {
        font-size: 2rem;
    }
    
    .developer-badges {
        flex-direction: column;
        align-items: center;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 1rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .developer-avatar {
        width: 100px;
        height: 100px;
        font-size: 50px;
    }
}

/* Loading and Error States */
.loading-spinner {
    border: 4px solid rgba(148, 163, 184, 0.3);
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    margin: 20px 0;
}

.success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    margin: 20px 0;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(51, 65, 85, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.5);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.7);
}

/* Touch-friendly improvements for all devices */
.nav-btn, .tab-btn, .voice-btn, .generate-btn, #sendBtn, #searchBtn, .read-btn {
    min-height: 44px; /* iOS guideline for touch targets */
    min-width: 44px;
    touch-action: manipulation; /* Prevents double-tap zoom */
}

/* Prevent zoom on input focus (iOS) */
input, textarea {
    font-size: 16px;
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 768px) {
    /* Navigation Improvements */
    .nav-container {
        padding: 1rem;
    }
    
    .nav-logo h1 {
        font-size: 20px;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px;
        border-radius: 8px;
        transition: background 0.3s ease;
    }
    
    .mobile-menu-btn:hover {
        background: rgba(100, 116, 139, 0.2);
    }
    
    .mobile-menu.show {
        display: flex;
    }
    
    /* Container and sections */
    .container {
        padding: 0 16px;
    }
    
    .section {
        padding-top: 70px;
    }
    
    /* Section headers */
    .section-header h2 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .section-header p {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    /* AI Tabs responsive */
    .ai-tabs {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 1.5rem;
        padding: 0 10px;
    }
    
    .tab-btn {
        width: 100%;
        padding: 14px 20px;
        justify-content: center;
        font-size: 14px;
    }
    
    /* Chat interface mobile */
    .chat-container {
        height: calc(100vh - 200px);
        margin: 0 -16px;
        border-radius: 16px 16px 0 0;
    }
    
    .chat-messages {
        height: calc(100% - 80px);
        padding: 16px;
    }
    
    .message {
        margin-bottom: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .message.user-message {
        align-items: flex-end;
    }
    
    .message-content {
        max-width: 85%;
        padding: 12px 16px;
        font-size: 14px;
        line-height: 1.5;
    }
    
    .chat-input-container {
        padding: 16px;
        gap: 12px;
    }
    
    #chatInput {
        flex: 1;
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 12px;
    }
    
    #sendBtn {
        padding: 14px;
        min-width: 48px;
        min-height: 48px;
    }
    
    /* Voice interface mobile */
    .voice-container {
        padding: 20px 16px;
        text-align: center;
    }
    
    .voice-icon {
        width: 80px;
        height: 80px;
        margin: 0 auto 20px;
    }
    
    .voice-controls {
        flex-direction: column;
        gap: 12px;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .voice-btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 16px;
    }
    
    /* Image generation mobile */
    .image-container {
        padding: 20px 16px;
    }
    
    #imagePrompt {
        width: 100%;
        min-height: 100px;
        font-size: 16px;
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .generate-btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 16px;
        justify-content: center;
    }
    
    .generated-image {
        margin: 20px -16px 0;
    }
    
    .generated-image img {
        width: 100%;
        height: auto;
        border-radius: 16px 16px 0 0;
    }
    
    /* Library mobile */
    .search-container {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    #bookSearch {
        width: 100%;
        font-size: 16px;
        padding: 14px 16px;
    }
    
    #searchBtn {
        width: 100%;
        padding: 14px 20px;
        justify-content: center;
        font-size: 16px;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 16px;
        padding: 0 4px;
    }
    
    .book-card {
        min-height: 280px;
    }
    
    .book-cover img {
        height: 140px;
    }
    
    .book-title {
        font-size: 13px;
        line-height: 1.3;
    }
    
    .book-author {
        font-size: 11px;
    }
    
    .read-btn {
        padding: 8px 12px;
        font-size: 12px;
        gap: 4px;
    }
    
    /* Developer section mobile */
    .developer-card {
        margin: 0 -16px;
        border-radius: 20px 20px 0 0;
        padding: 24px 20px;
    }
    
    .developer-avatar {
        width: 80px;
        height: 80px;
        margin: 0 auto 16px;
    }
    
    .developer-badges {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .badge {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .skill-card {
        padding: 20px 16px;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .contact-card {
        padding: 16px;
        text-align: center;
    }
    
    .availability-card {
        text-align: center;
        padding: 20px 16px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .nav-container {
        padding: 0.8rem;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .chat-container {
        height: calc(100vh - 180px);
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 12px;
    }
    
    .book-card {
        min-height: 250px;
    }
    
    .book-cover img {
        height: 120px;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .section {
        padding-top: 60px;
    }
    
    .chat-container {
        height: calc(100vh - 120px);
    }
    
    .section-header {
        margin-bottom: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .voice-container {
        padding: 16px;
    }
    
    .voice-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 16px;
    }
}

/* Fix for better mobile interaction */
@media (hover: none) and (pointer: coarse) {
    /* Better touch experience on mobile devices */
    .nav-btn:hover, .tab-btn:hover, .voice-btn:hover, .generate-btn:hover {
        background: transparent;
    }
    
    .nav-btn:active, .tab-btn:active, .voice-btn:active, .generate-btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    .message {
        -webkit-user-select: text;
        user-select: text;
    }
}