/* Mobile-first styles for Pickup Line Generator */

:root {
    --color-primary: #E91E63;
    --color-primary-dark: #C2185B;
    --color-primary-light: #F8BBD9;
    --color-secondary: #9C27B0;
    --color-background: #FFF5F8;
    --color-surface: #FFFFFF;
    --color-text: #212121;
    --color-text-secondary: #757575;
    --color-success: #4CAF50;
    --color-error: #F44336;
    --color-border: #E0E0E0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition-speed: 0.3s;
}

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

html {
    font-size: 16px;
}

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

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Header */
.header {
    text-align: center;
    padding: 24px 0 16px;
}

.header h1 {
    font-size: 1.75rem;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

/* Main */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Selector Sections */
.selector-section {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.selector-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text);
}

.selector-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selector-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 120px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.selector-btn:hover {
    border-color: var(--color-primary-light);
    background: #FFF0F5;
}

.selector-btn:active {
    transform: scale(0.98);
}

.selector-btn.selected {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD9 100%);
    color: var(--color-primary-dark);
}

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

.selector-text {
    white-space: nowrap;
}

/* Generate Button */
.generate-btn {
    width: 100%;
    min-height: 56px;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.generate-btn:disabled {
    background: #BDBDBD;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-remaining {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.9;
}

/* Loading */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px;
}

.loading-container[hidden] {
    display: none;
}

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

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

.loading-text {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

/* Error */
.error-container {
    background: #FFEBEE;
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}

.error-container[hidden] {
    display: none;
}

.error-text {
    color: var(--color-error);
    margin-bottom: 12px;
}

.retry-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--color-error);
    color: white;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Results */
.results-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.results-section[hidden] {
    display: none;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.frase-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.frase-card:nth-child(1) { animation-delay: 0.05s; }
.frase-card:nth-child(2) { animation-delay: 0.1s; }
.frase-card:nth-child(3) { animation-delay: 0.15s; }
.frase-card:nth-child(4) { animation-delay: 0.2s; }
.frase-card:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.frase-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    margin-bottom: 12px;
}

.frase-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.action-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--color-background);
    color: var(--color-text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.action-btn:active {
    transform: scale(0.95);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-overlay[hidden] {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    max-width: 320px;
    width: 100%;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 1.5rem;
    color: var(--color-text);
    margin-bottom: 8px;
}

.modal-text {
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.modal-reset {
    font-size: 0.85rem;
    color: var(--color-primary);
    margin-bottom: 24px;
}

.modal-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--color-primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1001;
    animation: toastIn 0.3s ease;
}

.toast[hidden] {
    display: none;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 0 16px;
    margin-top: auto;
}

.footer p {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.footer a {
    color: var(--color-primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Tablet and up */
@media (min-width: 768px) {
    .container {
        padding: 24px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .selector-btn {
        flex: 0 1 auto;
        padding: 14px 20px;
    }

    .frase-text {
        font-size: 1.1rem;
    }
}
