/* Mika - Mobile-First Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --success: #10b981;
    --border: #475569;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* Only hide horizontal overflow */
    overflow-y: auto; /* Allow vertical overflow for animations */
}

/* Video Player Section */
.video-section {
    flex: 1;
    width: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 400px;
}

.video-player {
    width: auto;
    height: 100%;
    max-height: 100%;
    aspect-ratio: 9 / 16;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.mika-character {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    object-position: center center;
    position: absolute;
    top: 0;
    left: 0;
}

.mika-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    position: absolute;
    top: 0;
    left: 0;
    background: #000;
}

.placeholder {
    text-align: center;
    padding: 2rem;
}

.placeholder-text {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    background: linear-gradient(135deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.placeholder-subtext {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Previous Prompts Section */
.prompts-section {
    flex: 0 0 auto;
    padding: 1rem 0 0.75rem 0; /* Extra top padding for hover animation */
    overflow: visible; /* Allow hover animation to show */
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    padding: 0 1.5rem;
}

.prompts-grid {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: visible; /* Allow buttons to move up on hover */
    padding: 0.25rem 1.5rem 0.5rem 1.5rem; /* Extra top padding for hover animation */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep functionality */
.prompts-grid::-webkit-scrollbar {
    height: 6px;
}

.prompts-grid::-webkit-scrollbar-track {
    background: transparent;
}

.prompts-grid::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.prompts-grid::-webkit-scrollbar-thumb:hover {
    background: var(--surface-light);
}

.prompt-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 50px;
    min-width: 120px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.prompt-btn:hover:not(:disabled) {
    background: var(--surface-light);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.prompt-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.prompt-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* Input Section */
.input-section {
    flex: 0 0 auto;
    padding: 1rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.input-container {
    max-width: 600px;
    margin: 0 auto;
}

#promptInput {
    width: 100%;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: var(--text);
    font-size: 1rem;
    resize: none;
    margin-bottom: 0.75rem;
    font-family: inherit;
    line-height: 1.4;
}

#promptInput:focus {
    outline: none;
    border-color: var(--primary);
}

#promptInput::placeholder {
    color: var(--text-secondary);
}

.generate-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 0.75rem;
    padding: 1rem;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

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

.generate-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.25rem;
}

/* Payment Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface);
    border-radius: 1rem;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
}

.qr-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: white;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: #000;
    font-weight: 600;
}

.invoice-details {
    margin-bottom: 1.5rem;
}

.invoice-amount {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary);
}

.invoice-input {
    width: 100%;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: var(--text);
    font-size: 0.875rem;
    font-family: monospace;
    margin-bottom: 0.75rem;
}

.copy-btn {
    width: 100%;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--border);
}

.payment-status {
    text-align: center;
    padding: 1rem 0;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 4px solid var(--surface-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.payment-status p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive adjustments */
@media (min-width: 640px) {
    .prompts-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}
