/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #020617 100%);
    background-attachment: fixed;
    color: #f5f5f5;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* === HEADER === */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1rem 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fbbf24;
}

.hero-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e293b;
    padding: 0.25rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* === MAIN CONTAINER === */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* === HERO SECTION === */
.main {
    padding-top: 100px;
    padding-bottom: 4rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.gradient-text {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #eab308 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: #94a3b8;
    font-weight: 400;
}

.hero-desc {
    font-size: 1.25rem;
    color: #cbd5e1;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* === INPUT SECTION === */
.input-section {
    margin-bottom: 3rem;
}

.input-group {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

#topic {
    width: 100%;
    padding: 1.25rem 1rem 1.25rem 3.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    font-size: 1.125rem;
    color: #f8fafc;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    outline: none;
}

#topic::placeholder {
    color: #64748b;
}

#topic:focus {
    border-color: #fbbf24;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.1);
    transform: translateY(-2px);
}

#topic.focused {
    border-color: #fbbf24;
}

.input-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.25rem;
}

/* === BUTTONS === */
.btn-primary, .btn-secondary {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1e293b;
    border: none;
    padding: 1.25rem 2.5rem;
    border-radius: 16px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(251, 191, 36, 0.3);
    min-height: 56px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(251, 191, 36, 0.4);
}

.btn-primary.loading .btn-text {
    opacity: 0;
}

.btn-primary.loading {
    animation: pulse 1.5s infinite;
}

.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: #1e293b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.btn-loader.active {
    display: inline-block;
}

.btn-secondary {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 2px solid rgba(251, 191, 36, 0.3);
    box-shadow: none;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(251, 191, 36, 0.25);
    transform: translateY(-2px);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-secondary.active {
    background: rgba(251, 191, 36, 0.2);
}

/* === RESULT CARDS === */
.results-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.result-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #fbbf24);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.card-header i {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e293b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.promo-card {
    margin-top: 1rem;
}

.promo-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

/* === RESULT CONTENT === */
.result-content {
    min-height: 120px;
    font-size: 1.1rem;
    line-height: 1.7;
    white-space: pre-wrap;
    text-align: left;
}

.loading-text {
    color: #94a3b8;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
}

.error-message {
    text-align: center;
    color: #f87171;
    padding: 2rem;
}

.error-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.btn-retry, .btn-copy, .btn-promo {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 2px solid rgba(251, 191, 36, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-copy:hover, .btn-promo:hover, .btn-retry:hover {
    background: rgba(251, 191, 36, 0.3);
    transform: translateY(-1px);
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* === MARKDOWN STYLES === */
.result-markdown h2, .promo-markdown h2 {
    color: #fbbf24;
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
    font-weight: 600;
}

.result-markdown h3, .promo-markdown h3 {
    color: #f59e0b;
    font-size: 1.25rem;
    margin: 1.25rem 0 0.75rem;
}

.result-markdown h4, .promo-markdown h4 {
    color: #eab308;
    font-size: 1.125rem;
    margin: 1rem 0 0.5rem;
}

.markdown-list {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0.5rem 0;
    padding-left: 1rem;
}

.markdown-list i {
    color: #fbbf24;
    margin-top: 0.25rem;
    flex-shrink: 0;
}

strong {
    color: #fbbf24;
    font-weight: 600;
}

a {
    color: #60a5fa;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* === NOTIFICATIONS === */
.notification {
    position: fixed;
    top: 100px;
    right: -400px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.notification-success {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.notification-error {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.notification.show {
    right: 2rem;
}

/* === LOADING OVERLAY === */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(251, 191, 36, 0.2);
    border-top: #fbbf24;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

/* === FOOTER === */
.footer {
    margin-top: auto;
    padding: 3rem 0 2rem;
    text-align: center;
    color: #64748b;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer i {
    color: #10a37f;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .main {
        padding-top: 80px;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .notification {
        right: 1rem !important;
        left: 1rem !important;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .hero-desc {
        font-size: 1.125rem;
    }
    
    .result-card {
        padding: 1.5rem;
    }
}   

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(251, 191, 36, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(251, 191, 36, 0.5);
}