/* assets/css/style.css - Main stylesheet */

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

:root {
    --primary-color: #00d4ff;
    --primary-hover: #00b8e6;
    --secondary-color: #7c3aed;
    --accent-color: #ff006e;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --background: #ffffff;
    --background-alt: #f8fafc;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 212, 255, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 212, 255, 0.15);
    --shadow-xl: 0 20px 25px -5px rgba(0, 212, 255, 0.2);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.3);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    position: relative;
    color: white;
    padding: 4rem 0;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 0, 110, 0.1) 0%, transparent 40%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

.generations-left {
    margin-top: 1.5rem;
}

.badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(124, 58, 237, 0.3));
    border: 1px solid rgba(0, 212, 255, 0.5);
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

/* Generator Section */
.generator-section {
    padding: 3rem 0;
}

.generator-card, .result-card {
    background: var(--background);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0, 212, 255, 0.1);
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.generator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

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

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

.label-hint {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15), 0 0 20px rgba(0, 212, 255, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.char-count {
    text-align: right;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Aspect Ratio Selector */
.ratio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.ratio-option {
    cursor: pointer;
}

.ratio-option input[type="radio"] {
    display: none;
}

.ratio-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    transition: all 0.2s;
}

.ratio-option input[type="radio"]:checked + .ratio-card {
    border-color: var(--primary-color);
    background: rgba(0, 212, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.ratio-card:hover {
    border-color: var(--primary-color);
}

.ratio-preview {
    width: 60px;
    height: 60px;
    margin: 0 auto 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--background-alt);
}

.ratio-preview[data-ratio="1:1"] {
    width: 60px;
    height: 60px;
}

.ratio-preview[data-ratio="16:9"] {
    width: 60px;
    height: 34px;
}

.ratio-preview[data-ratio="9:16"] {
    width: 34px;
    height: 60px;
}

.ratio-preview[data-ratio="4:3"] {
    width: 60px;
    height: 45px;
}

.ratio-preview[data-ratio="3:4"] {
    width: 45px;
    height: 60px;
}

.ratio-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: 1px solid rgba(0, 212, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-primary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.btn-large {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Result Section */
.result-section {
    margin-top: 2rem;
}

.result-image-container {
    text-align: center;
    margin: 2rem 0;
}

.result-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 2px solid rgba(0, 212, 255, 0.2);
    transition: transform 0.3s ease;
}

.result-image:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-glow);
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.result-prompt {
    background: var(--background-alt);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.result-prompt h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.result-prompt p {
    color: var(--text-primary);
}

/* Inline Result - New UX */
.inline-result {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
    animation: fadeSlideIn 0.4s ease-out;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Disabled State */
.generator-card.generating form {
    pointer-events: none;
}

/* Status Box */
.status-box {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(124, 58, 237, 0.05));
    border: 2px solid rgba(0, 212, 255, 0.2);
    border-radius: var(--radius-lg);
    text-align: center;
    animation: fadeSlideIn 0.4s ease-out;
}

.status-box.loading {
    border-color: var(--primary-color);
}

.status-box.success {
    border-color: var(--success-color);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(0, 212, 255, 0.05));
}

.status-box.error {
    border-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.05);
}

.status-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.status-box.success .status-icon,
.status-box.error .status-icon {
    animation: none;
}

.status-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.generation-timer {
    display: inline-block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-top: 1rem;
    font-variant-numeric: tabular-nums;
}

/* Limit Reached Card */
.limit-reached-card {
    text-align: center;
    padding: 3rem 2rem;
}

.limit-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.limit-reached-card h3 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.limit-reached-card p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--background);
    padding: 2rem;
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
}

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

.modal-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin: 1rem 0;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning-color);
    color: var(--warning-color);
}

/* Sections */
.section {
    padding: 4rem 0;
}

.section-alt {
    background: var(--background-alt);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

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

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-glow);
    border: 2px solid rgba(0, 212, 255, 0.3);
}

.step-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.step-card p {
    color: var(--text-secondary);
}

/* Examples Grid */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.example-card {
    background: var(--background);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s;
}

.example-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.example-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.example-card p {
    color: var(--text-secondary);
}

/* FAQ Grid */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.faq-item h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.faq-item p {
    color: var(--text-secondary);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.footer-content p {
    margin-bottom: 0.5rem;
}

.footer-note {
    opacity: 0.7;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .nav {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.875rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .ratio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .generator-card {
        padding: 1.5rem;
    }
}
