/* ====================================
   AI PROMPT GENERATOR - MOBILE FIRST CSS
   ==================================== */

/* CSS Variables */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: #16161f;
    --bg-card-hover: #1e1e2a;
    --bg-card-selected: #252535;

    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;

    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    --border-color: #2a2a3a;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
#app {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Progress Bar */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--bg-tertiary);
    z-index: 100;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    width: 0%;
    transition: width var(--transition-normal);
    box-shadow: 0 0 10px var(--accent-glow);
}

.progress-text {
    position: fixed;
    top: 12px;
    right: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    z-index: 101;
}

/* Wizard Container */
.wizard-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 60px 16px 24px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* Steps */
.step {
    display: none;
    flex-direction: column;
    animation: fadeIn var(--transition-normal);
}

.step.active {
    display: flex;
    flex: 1;
}

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

/* Step Titles */
.step-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.step-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.card.selected {
    background: var(--bg-card-selected);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

.card.selected::before {
    opacity: 0.1;
}

.card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-secondary);
    position: relative;
    z-index: 1;
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

.card.selected .card-icon {
    color: var(--accent-primary);
}

.card-label {
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    position: relative;
    z-index: 1;
}

.card-limit {
    font-size: 0.7rem;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

.card-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Multi-select indicator */
.multi-select .card.selected::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.multi-select .card.selected::after {
    content: '\2713';
    color: white;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom Input */
.custom-input-container {
    margin-bottom: 24px;
}

.custom-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-family);
    transition: all var(--transition-fast);
}

.custom-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.custom-input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn-continue {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

.btn-continue::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn-continue:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 20px var(--accent-glow);
}

.btn-continue:hover:not(:disabled)::before {
    opacity: 1;
}

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

.btn-continue span {
    position: relative;
    z-index: 1;
}

.btn-generate {
    background: linear-gradient(135deg, var(--success), #059669);
}

/* Loading Screen */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 24px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-size: 1.25rem;
    font-weight: 600;
}

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

/* Result Screen */
.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.platform-badge {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-secondary);
}

.result-container {
    margin-bottom: 32px;
}

.prompt-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.prompt-box textarea {
    width: 100%;
    min-height: 150px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-family);
    line-height: 1.6;
    resize: vertical;
}

.prompt-box textarea:focus {
    outline: none;
}

.prompt-stats {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.btn-copy {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-copy:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-copy.copied {
    background: var(--success);
}

/* Feedback Section */
.feedback-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.feedback-section h3 {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.feedback-section textarea {
    width: 100%;
    min-height: 80px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-family);
    resize: vertical;
    margin-bottom: 12px;
}

.feedback-section textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.feedback-section textarea::placeholder {
    color: var(--text-muted);
}

.btn-feedback {
    width: 100%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-feedback:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.btn-feedback.sent {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

/* Restart Button */
.btn-restart {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 14px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-restart:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 24px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transition: all var(--transition-normal);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.toast.error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

/* Responsive - Tablet */
@media (min-width: 480px) {
    .wizard-container {
        padding: 70px 24px 32px;
    }

    .step-title {
        font-size: 2rem;
    }

    .cards-grid {
        gap: 16px;
    }

    .card {
        padding: 24px 16px;
    }

    .card-icon {
        width: 48px;
        height: 48px;
    }

    .card-label {
        font-size: 0.9rem;
    }
}

/* Responsive - Desktop */
@media (min-width: 768px) {
    .wizard-container {
        padding: 80px 32px 40px;
    }

    .step-title {
        font-size: 2.25rem;
    }

    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .card {
        padding: 28px 20px;
    }

    .card-icon {
        width: 52px;
        height: 52px;
    }
}

/* Responsive - Large Desktop */
@media (min-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Navigation Buttons Container */
.nav-buttons {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.nav-buttons .btn-back {
    flex: 0 0 auto;
    min-width: 100px;
}

.nav-buttons .btn-continue {
    flex: 1;
    margin-top: 0;
}

/* Back Button */
.btn-back {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-back:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-back svg {
    width: 16px;
    height: 16px;
}

/* Extra Notes Input (Step 5) */
.extra-input-container {
    margin-bottom: 24px;
}

.extra-input {
    width: 100%;
    min-height: 150px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-family);
    line-height: 1.6;
    resize: vertical;
    transition: all var(--transition-fast);
}

.extra-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.extra-input::placeholder {
    color: var(--text-muted);
}

/* Responsive adjustments for nav buttons */
@media (max-width: 400px) {
    .nav-buttons {
        flex-direction: column-reverse;
    }

    .nav-buttons .btn-back {
        width: 100%;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    padding: 32px 24px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

/* Info Modal */
.info-modal .info-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    color: var(--accent-primary);
}

.info-modal .info-icon svg {
    width: 100%;
    height: 100%;
}

.info-modal h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.info-modal .info-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.btn-info-close {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-info-close:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 20px var(--accent-glow);
}

/* Rate Limit Modal */
.rate-limit-modal .countdown-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    color: var(--warning);
    animation: pulse 2s infinite;
}

.rate-limit-modal .countdown-icon svg {
    width: 100%;
    height: 100%;
}

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

.rate-limit-modal h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.rate-limit-modal p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.countdown-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px 24px;
}

.countdown-timer #countdownSeconds {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--warning);
    font-variant-numeric: tabular-nums;
}

.countdown-timer span:last-child {
    font-size: 1rem;
    color: var(--text-secondary);
}
