/*
 * Tea House - Mobile CSS
 * Warm, calming, minimalist aesthetic
 */

:root {
    /* Warm neutral color palette */
    --color-cream: #F5F1E8;
    --color-beige: #E8DCC4;
    --color-soft-brown: #C4B5A0;
    --color-warm-brown: #8B7355;
    --color-deep-brown: #5C4A3A;
    --color-text-primary: #4A3F35;
    --color-text-secondary: #8B7355;

    /* Accent colors (muted) */
    --color-accent-calm: #A8B5A0;
    --color-accent-warm: #D4A574;
    --color-accent-gentle: #C4A89F;

    /* Emotion colors */
    --emotion-tension: #DC2626;        /* Red */
    --emotion-melancholy: #1E40AF;     /* Deep Blue */
    --emotion-agitation: #EA580C;      /* Orange */
    --emotion-isolation: #9CA3AF;      /* Grey */
    --emotion-confusion: #EAB308;      /* Yellow */
    --emotion-weariness: #92400E;      /* Brown */
    --emotion-bitterness: #166534;     /* Dark Green */
    --emotion-yearning: #7C3AED;       /* Violet */

    /* Shadows and borders */
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-gentle: 0 4px 12px rgba(0, 0, 0, 0.06);
    --border-soft: 1px solid rgba(139, 115, 85, 0.15);

    /* Transitions */
    --transition-slow: 0.4s ease;
    --transition-gentle: 0.3s ease;
}

/* Base Mobile Styles */
body {
    font-family: 'Crimson Text', 'Georgia', serif;
    background-color: var(--color-cream);
    color: var(--color-text-primary);
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Lora', 'Georgia', serif;
    font-weight: 500;
    color: var(--color-deep-brown);
    margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* Mobile Container */
.mobile-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--color-cream);
}

/* Main Content Area */
.mobile-content {
    flex: 1;
    padding: 1.5rem;
    padding-top: calc(2.5rem + 1.5rem); /* Space for top banner + normal padding */
    padding-bottom: 3rem; /* Space for bottom nav */
    overflow-y: auto;
    overflow-x: hidden;

    /* Hide scrollbar for webkit browsers (Chrome, Safari) */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.mobile-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Buttons */
.btn-mobile-primary {
    background-color: var(--color-warm-brown);
    color: var(--color-cream);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    border-radius: 12px;
    font-family: 'Lora', 'Georgia', serif;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-gentle);
    box-shadow: var(--shadow-soft);
    width: 100%;
    max-width: 320px;
    display: block;
    margin: 0 auto;
    text-align: center;
    text-decoration: none;
}

.btn-mobile-primary:hover,
.btn-mobile-primary:focus {
    background-color: var(--color-deep-brown);
    box-shadow: var(--shadow-gentle);
    transform: translateY(-2px);
}

.btn-mobile-secondary {
    background-color: transparent;
    color: var(--color-warm-brown);
    border: 2px solid var(--color-warm-brown);
    padding: 0.875rem 2rem;
    font-size: 1rem;
    border-radius: 12px;
    font-family: 'Lora', 'Georgia', serif;
    cursor: pointer;
    transition: all var(--transition-gentle);
    width: 100%;
    max-width: 320px;
    display: block;
    margin: 0 auto;
    text-align: center;
    text-decoration: none;
}

.btn-mobile-secondary:hover,
.btn-mobile-secondary:focus {
    background-color: var(--color-beige);
    transform: translateY(-1px);
}

/* Top Banner */
.mobile-top-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--color-beige);
    padding: 0.35rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: var(--border-soft);
    box-shadow: var(--shadow-soft);
    z-index: 1000;
    max-width: 480px;
    margin: 0 auto;
}

.mobile-banner-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-deep-brown);
    margin: 0;
    font-family: 'Lora', 'Georgia', serif;
}

.mobile-banner-icons {
    display: flex;
    gap: 0.75rem;
}

.mobile-icon-btn {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--color-warm-brown);
    cursor: pointer;
    padding: 0.25rem;
    transition: all var(--transition-gentle);
    text-decoration: none;
}

.mobile-icon-btn:hover {
    color: var(--color-deep-brown);
    transform: scale(1.1);
}

/* Bottom Tab Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--color-beige);
    border-top: var(--border-soft);
    display: flex;
    justify-content: space-around;
    padding: 0.25rem 0.5rem;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    z-index: 1000;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--color-text-secondary);
    transition: all var(--transition-gentle);
    padding: 0.25rem;
    border-radius: 8px;
    position: relative;
}

.mobile-nav-item:hover {
    background-color: var(--color-cream);
}

.mobile-nav-item.active {
    color: var(--color-deep-brown);
    background-color: var(--color-cream);
}

.mobile-nav-icon {
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.125rem;
    object-fit: contain;
}

.mobile-nav-label {
    font-size: 0.95rem;
    font-family: 'Lora', 'Georgia', serif;
}

/* Flash animation for tabs - obvious pulsing glow */
@keyframes tab-flash {
    0%, 100% {
        background-color: rgba(255, 215, 0, 0.2);
        box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
    }
    50% {
        background-color: rgba(255, 215, 0, 0.6);
        box-shadow: 0 0 24px rgba(255, 215, 0, 0.9), 0 0 12px rgba(255, 215, 0, 0.7);
    }
}

.mobile-nav-item.flash {
    animation: tab-flash 1.5s ease-in-out infinite;
}

/* Sub-Tab Switcher (Pill Style) */
.sub-tab-switcher {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 1rem;
    background-color: var(--color-beige);
    padding: 0.25rem;
    border-radius: 10px;
    border: var(--border-soft);
}

.sub-tab-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-family: 'Lora', 'Georgia', serif;
    font-weight: 500;
    color: var(--color-text-secondary);
    background-color: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-gentle);
    text-decoration: none;
    text-align: center;
}

.sub-tab-btn:hover {
    color: var(--color-deep-brown);
    background-color: rgba(255, 255, 255, 0.5);
}

.sub-tab-btn.active {
    background-color: white;
    color: var(--color-deep-brown);
    box-shadow: var(--shadow-soft);
}

/* Cards and Panels */
.mobile-card {
    background-color: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-soft);
    border: var(--border-soft);
}

.mobile-panel {
    background-color: var(--color-beige);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Welcome Page Specific */
.welcome-container {
    text-align: center;
    padding-top: 2rem;
}

.welcome-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--color-deep-brown);
}

.welcome-subtitle {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
}

.welcome-quote {
    font-style: italic;
    color: var(--color-text-secondary);
    margin: 1rem 0;
    padding: 0 1rem;
}

.welcome-status {
    text-align: left;
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-soft);
}

.welcome-status h3 {
    margin-top: 0;
    font-size: 1.125rem;
}

.welcome-status ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.welcome-status li {
    padding: 0.5rem 0;
    color: var(--color-text-primary);
}

.welcome-status li:before {
    content: "• ";
    color: var(--color-accent-warm);
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Login Page Specific */
.login-container {
    padding-top: 3rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-form {
    background-color: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-soft);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
    font-weight: 500;
    font-size: 1rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    border: 2px solid var(--color-soft-brown);
    border-radius: 8px;
    background-color: var(--color-cream);
    color: var(--color-text-primary);
    font-family: 'Crimson Text', 'Georgia', serif;
    transition: all var(--transition-gentle);
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-warm-brown);
    background-color: white;
}

.form-divider {
    text-align: center;
    margin: 1.5rem 0;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.social-login-btn {
    background-color: white;
    color: var(--color-text-primary);
    border: 2px solid var(--color-soft-brown);
    padding: 0.875rem;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-gentle);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    text-decoration: none;
}

.social-login-btn:hover {
    background-color: var(--color-cream);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

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

.fade-in {
    animation: fadeIn var(--transition-slow) ease-out;
}

/* Gentle sparkle for stars (for future use) */
@keyframes sparkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.sparkle {
    animation: sparkle 2s ease-in-out infinite;
}

/* Responsive adjustments */
@media (max-width: 375px) {
    body {
        font-size: 16px;
    }

    .mobile-content {
        padding: 1rem;
    }

    .btn-mobile-primary,
    .btn-mobile-secondary {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* Patron Grid (2-wide layout) */
.patron-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.patron-card {
    background-color: white;
    border-radius: 12px;
    padding: 0.875rem;
    box-shadow: var(--shadow-soft);
    border: var(--border-soft);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-gentle);
    cursor: pointer;
}

.patron-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gentle);
}

.patron-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 0.5rem;
}

.patron-label {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.375rem 0;
    color: var(--color-deep-brown);
    text-align: center;
}

.patron-intro {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin: 0 0 0.625rem 0;
    line-height: 1.4;
    flex-grow: 1;
    text-align: center;
}

/* State Indicators */
.state-discovery {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.375rem 0;
}

.emotion-bubble {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid var(--color-soft-brown);
    background-color: transparent;
    transition: all 0.3s ease;
}

/* Unknown emotion - default grey border */
.emotion-bubble.unknown {
    border-color: var(--color-soft-brown);
    background-color: transparent;
}

/* Partial understanding - colored border based on emotion */
.emotion-bubble.partial {
    background-color: transparent;
}

.emotion-bubble.partial.tension { border-color: var(--emotion-tension); }
.emotion-bubble.partial.melancholy { border-color: var(--emotion-melancholy); }
.emotion-bubble.partial.agitation { border-color: var(--emotion-agitation); }
.emotion-bubble.partial.isolation { border-color: var(--emotion-isolation); }
.emotion-bubble.partial.confusion { border-color: var(--emotion-confusion); }
.emotion-bubble.partial.weariness { border-color: var(--emotion-weariness); }
.emotion-bubble.partial.bitterness { border-color: var(--emotion-bitterness); }
.emotion-bubble.partial.yearning { border-color: var(--emotion-yearning); }

/* Core understanding - filled with emotion color */
.emotion-bubble.core {
    border: none;
}

.emotion-bubble.core.tension { background-color: var(--emotion-tension); }
.emotion-bubble.core.melancholy { background-color: var(--emotion-melancholy); }
.emotion-bubble.core.agitation { background-color: var(--emotion-agitation); }
.emotion-bubble.core.isolation { background-color: var(--emotion-isolation); }
.emotion-bubble.core.confusion { background-color: var(--emotion-confusion); }
.emotion-bubble.core.weariness { background-color: var(--emotion-weariness); }
.emotion-bubble.core.bitterness { background-color: var(--emotion-bitterness); }
.emotion-bubble.core.yearning { background-color: var(--emotion-yearning); }

/* Legacy filled class for backwards compatibility */
.emotion-bubble.filled {
    background-color: var(--color-accent-calm);
    border-color: var(--color-accent-calm);
}

.state-waiting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.375rem 0;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.state-waiting .icon {
    font-size: 1rem;
}

.state-served {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0;
}

.state-served .icon {
    font-size: 1rem;
}

.state-served .progress-bar {
    flex: 1;
    height: 6px;
    background-color: var(--color-beige);
    border-radius: 3px;
    overflow: hidden;
}

.state-served .progress-fill {
    height: 100%;
    background-color: var(--color-accent-calm);
    transition: width 0.3s ease;
}

.state-awaiting-tea {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.375rem 0;
    font-size: 0.75rem;
    color: #6B8E23;  /* Green tea color */
    font-weight: 600;
}

.state-awaiting-tea .icon {
    font-size: 1rem;
}

.state-awaiting-tea-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #6B8E23 0%, #556B2F 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-family: 'Lora', 'Georgia', serif;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(107, 142, 35, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.state-awaiting-tea-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(107, 142, 35, 0.4);
}

.awaiting-tea-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/* Ensure portrait mode only */
@media (orientation: landscape) {
    body::before {
        content: "Please rotate your device to portrait mode for the best experience.";
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--color-cream);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2rem;
        text-align: center;
        font-size: 1.25rem;
        color: var(--color-deep-brown);
        z-index: 9999;
    }
}
