* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background-image: url('/forest-background.jpeg');
    background-size: contain;
    background-position: center center;
    background-attachment: fixed;
	background-repeat: no-repeat;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
}

/* Header */
.header {
    background: linear-gradient(135deg, #2d5016 0%, #3a6b1e 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Logo with white circle background */
.logo-left, .logo-right {
    width: 35px;
    height: 35px;
    background: white;
    border-radius: 50%;
    padding: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Transcript with forest background */
.transcript-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-image: url('/forest-background.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: local;
    position: relative;
    margin: 10px;
    border-radius: 15px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.transcript-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.28);
    border-radius: 15px;
    pointer-events: none;
    z-index: 0;
}

.message {
    position: relative;
    z-index: 1;
    margin-bottom: 15px;
    padding: 12px 15px;
    border-radius: 12px;
    font-size: 17px;
    line-height: 1.6;
    animation: fadeIn 0.4s ease;
}

.app-title {
    color: white;
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 1px;
}

.share-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}



@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    margin-left: 20px;
}

.ai-message {
    background: #f5f5dc;
    border-left: 4px solid #8b7355;
}

.message strong {
    display: block;
    margin-bottom: 5px;
    font-size: 15px;
    opacity: 0.7;
}

/* Hooks */
/* --- SUGGESTION HOOKS (The "Chips") --- */
.hooks-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    padding: 0 10px;
}

.hook {
    /* distinct white card look */
    background: #ffffff; 
    border: 1px solid #d4e0c8; /* subtle green border */
    border-left: 4px solid #4a6741; /* accent bar on left */
    
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    
    /* Typography */
    font-size: 0.95rem; /* Slightly smaller than chat */
    color: #2c3e22; /* Dark forest green text */
    font-weight: 500;
    
    /* Interactive Feel */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    
    display: flex;
    align-items: center;
    gap: 10px;
}

.hook:hover {
    transform: translateY(-2px); /* Pops up slightly */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background: #fdfdfd;
}

.hook:active {
    transform: scale(0.98);
}

.hook-icon {
    font-size: 1.1rem;
    opacity: 0.8;
}

.hook-text {
    font-size: 18px;
    color: #333;
    line-height: 1.4;
}

/* Text Input */
.input-container {
    padding: 10px 20px;
    display: flex;
    gap: 10px;
}

.text-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 25px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    outline: none;
    transition: all 0.3s ease;
}

.text-input::placeholder {
    color: #999;
    font-style: italic;
}

.text-input:focus {
    border-color: #2d5016;
    box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
}

.send-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #2d5016;
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-btn:hover {
    background: #3a6b1e;
    transform: scale(1.05);
}

/* Microphone */
.mic-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: rgba(180, 200, 170, 0.4);
}

.mic-button {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 4px solid #2d5016;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.mic-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.mic-button:active {
    transform: scale(0.95);
}

.mic-button.recording {
    background: #ff6b6b;
    border-color: #c92a2a;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.mic-icon {
    width: 45px;
    height: 45px;
    color: #2d5016;
}

.mic-button.recording .mic-icon {
    color: white;
}

.recording-indicator {
    color: #c92a2a;
    font-size: 16px;
    font-weight: bold;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Scrollbar */
.transcript-container::-webkit-scrollbar {
    width: 8px;
}

.transcript-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.transcript-container::-webkit-scrollbar-thumb {
    background: rgba(45, 80, 22, 0.3);
    border-radius: 10px;
}

.transcript-container::-webkit-scrollbar-thumb:hover {
    background: rgba(45, 80, 22, 0.5);
}

/* Mobile Responsiveness */
@media (max-width: 500px) {
    .app-container {
        max-width: 100%;
    }
    
    .app-title {
        font-size: 24px;
    }
    
    .logo-left, .logo-right {
        width: 30px;
		height: 30px;
    }
}

/* Loading Card Styling */
.loading-card {
    background-color: #f0f4f8; /* Soft blue-grey, distinct from chat bubbles */
    border: 1px solid #d1d9e6;
    border-radius: 12px;
    padding: 15px 20px;
    margin: 10px 0;
    font-family: 'Segoe UI', sans-serif; /* Or your app's font */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    animation: fadeIn 0.5s ease-in;
	opacity: 1;
    transition: opacity 2s ease-out, margin-top 2s ease-out; /* 2-second slow fade */
}

.loading-card.fade-out {
    opacity: 0;
    margin-top: -50px; /* Slight slide up effect during fade */
    pointer-events: none; /* Prevent clicks while fading */
}

/* Update the footer to look less like a "spinner" and more like a footer */
.loading-footer {
    /* ... existing styles ... */
    transition: opacity 0.5s;
}

.loading-header {
    color: #555;
    font-size: 0.9em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fact-text {
    font-size: 1.1em;
    font-style: italic;
    color: #2d3748;
    line-height: 1.5;
    margin-bottom: 10px;
    display: block;
}

.fact-source {
    font-size: 0.85em;
    color: #718096;
    text-align: right;
    font-weight: 600;
}

.loading-footer {
    border-top: 1px solid #e2e8f0;
    margin-top: 12px;
    padding-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5568;
    font-size: 0.9em;
    font-weight: 500;
}

/* The 'Action' Footer inside the card */
.card-action-area {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    opacity: 0; /* Hidden initially, fades in */
    animation: fadeIn 1s ease-out 1.5s forwards; /* Fades in after 1.5s */
}

.continue-btn {
    /* "Forest Green" Gradient - Richer and more grounded */
    background: linear-gradient(135deg, #2f855a 0%, #22543d 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1em;
    border-radius: 50px;
    cursor: pointer;
    /* Soft shadow to lift it */
    box-shadow: 0 4px 10px rgba(47, 133, 90, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(72, 187, 120, 0.4);
}

.continue-btn:active {
    transform: scale(0.98);
}

/* Adjust the pulse to match the darker green */
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(47, 133, 90, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(47, 133, 90, 0); }
    100% { box-shadow: 0 0 0 0 rgba(47, 133, 90, 0); }
}

.continue-btn.ready {
    animation: pulse-green 2s infinite;
}

/* Modal Overlay - Darkens the background */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; /* Ensure it is above everything */
}

/* The Box itself */
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 85%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.end-btn {
    background: #e53e3e; /* Subtle red to indicate closing */
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-right: 8px;
    cursor: pointer;
}

/* Simple Spinner Animation */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #cbd5e0;
    border-top: 2px solid #4a5568;
    border-radius: 50%;
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

.install-nudge {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #2d5016;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.install-nudge button {
    background: white;
    color: #2d5016;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.install-nudge button:hover {
    background: #e0e7ff;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #f7f9f4;
}

#app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  flex: 0 0 auto;
}

.transcript-container {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
  padding: 16px;
}

.hooks-container {
  flex: 0 0 auto;
}

.input-container,
.mic-container {
  flex: 0 0 auto;
  padding: 12px 16px;
  background: #f7f9f4;
}

/* Mobile scroll fix: let the scrollable flex child shrink */
.app-container {
  height: 100dvh;        /* better on mobile than 100vh */
  max-height: 100dvh;
  min-height: 0;         /* allow children to shrink */
}

.transcript-container {
  flex: 1 1 auto;
  min-height: 0;         /* critical for scroll in flex layouts */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.hooks-container,
.input-container,
.mic-container {
  flex-shrink: 0;        /* keep controls from collapsing */
}

/* Mobile scroll + keyboard friendliness overrides */
html, body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #f7f9f4;
}

/* Let the flex layout fill the viewport and allow children to shrink */
.app-container {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Remove extra margin that steals vertical space; enable scrolling */
.transcript-container {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;                /* important: was 10px */
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Keep controls visible and non-collapsing */
.hooks-container,
.input-container,
.mic-container {
  flex-shrink: 0;
  background: #f7f9f4;
}

/* Optional: reduce vertical padding on very small screens */
@media (max-width: 500px) {
  .input-container { padding: 10px 12px; }
  .mic-container   { padding: 12px; }
}