/* Design System Tokens */
:root {
    --bg-base: #090D16;
    --bg-card: #131A26;
    --bg-input: #1B2433;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(212, 175, 55, 0.3);
    
    --primary: #D4AF37; /* Metallic Gold */
    --primary-hover: #F3CD5F;
    --primary-glow: rgba(212, 175, 55, 0.12);
    --primary-glow-strong: rgba(212, 175, 55, 0.3);
    
    --text-main: #F1F5F9;
    --text-muted: #94A3B8;
    --text-dark: #0F172A;
    
    --shopee-color: #EE4D2D;
    --shopee-glow: rgba(238, 77, 45, 0.15);
    --amazon-color: #FF9900;
    --amazon-glow: rgba(255, 153, 0, 0.15);
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(212, 175, 55, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(27, 36, 51, 0.4) 0%, transparent 50%);
    background-attachment: fixed;
}

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

/* Header Styles */
.app-header {
    padding: 60px 0 40px;
    text-align: center;
    position: relative;
}

.logo-area {
    margin-bottom: 16px;
}

.logo-badge {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: var(--text-dark);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 6px 16px;
    border-radius: 30px;
    display: inline-block;
    box-shadow: 0 4px 15px var(--primary-glow-strong);
    text-decoration: none;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.logo-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45);
}

.app-header h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #FFFFFF 30%, #E2E8F0 70%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-header .subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Card Styling */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(10px);
}

/* Navigation Tabs */
.tabs-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
    padding: 6px;
    background-color: rgba(19, 26, 38, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 40px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    overflow-x: auto;
    max-width: 100%;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 30px;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    background-color: var(--primary);
    color: var(--text-dark);
    box-shadow: 0 4px 15px var(--primary-glow-strong);
}

.tab-icon {
    width: 18px;
    height: 18px;
    transition: var(--transition-smooth);
}

.tab-btn.active .tab-icon {
    stroke: var(--text-dark);
}

/* Generator Grid Layout */
.generator-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 32px;
    align-items: start;
    margin-bottom: 80px;
}

/* Config Panel Styles */
.config-panel {
    padding: 32px;
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-content {
    display: none;
}

.panel-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

select, input[type="text"] {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
    outline: none;
}

select:focus, input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Custom Range Slider */
input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow-strong);
    transition: var(--transition-smooth);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.range-display {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

/* Preview Panel Styles */
.preview-panel {
    padding: 32px;
    position: sticky;
    top: 24px;
    border-color: rgba(212, 175, 55, 0.15);
    background-image: linear-gradient(180deg, var(--bg-card) 0%, rgba(19, 26, 38, 0.9) 100%);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.preview-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    background-color: var(--primary-glow);
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: var(--primary);
    border-radius: 4px;
}

/* Prompt Box Wrapper and Clipboard Success */
.prompt-box-wrapper {
    position: relative;
    margin-bottom: 24px;
}

.prompt-box {
    width: 100%;
    min-height: 200px;
    background-color: #070A0F;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    padding: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    color: #E2E8F0;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    user-select: all;
    max-height: 350px;
    overflow-y: auto;
}

.copy-success-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background-color: rgba(9, 13, 22, 0.95);
    border: 1px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.copy-success-msg.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
    width: 100%;
    text-decoration: none;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: var(--text-dark);
    box-shadow: 0 4px 20px var(--primary-glow-strong);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.45);
}

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

.prompt-tip {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.tip-icon {
    width: 20px;
    height: 20px;
    stroke: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.prompt-tip p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Affiliate Products Section Styling */
.affiliates-section {
    padding: 80px 0;
    border-top: 1px solid var(--border-color);
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.section-header p {
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.product-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--transition-smooth);
    border-color: rgba(255, 255, 255, 0.04);
}

.product-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 15px var(--primary-glow);
}

.product-icon-wrapper {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.01);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.product-icon-wrapper::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background: var(--primary-glow);
    border-radius: 50%;
    filter: blur(20px);
}

.product-svg {
    width: 90px;
    height: 90px;
    z-index: 1;
    transition: var(--transition-smooth);
}

.product-card:hover .product-svg {
    transform: scale(1.08) rotate(2deg);
}

.product-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    background-color: var(--primary-glow);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 12px;
}

.product-info h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-info p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    flex-grow: 1;
}

.product-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: auto;
}

.product-buttons a {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 10px 0;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.btn-shopee {
    background-color: var(--shopee-glow);
    border: 1px solid rgba(238, 77, 45, 0.3);
}

.btn-shopee:hover {
    background-color: var(--shopee-color);
    box-shadow: 0 4px 15px var(--shopee-glow);
    transform: translateY(-1px);
}

.btn-amazon {
    background-color: var(--amazon-glow);
    border: 1px solid rgba(255, 153, 0, 0.3);
}

.btn-amazon:hover {
    background-color: var(--amazon-color);
    color: var(--text-dark);
    box-shadow: 0 4px 15px var(--amazon-glow);
    transform: translateY(-1px);
}

.product-buttons a span {
    margin-right: 4px;
}

/* Footer Styling */
.app-footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    background-color: rgba(9, 13, 22, 0.8);
}

.app-footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

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

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

/* FAQ Section Styling */
.faq-section {
    padding: 60px 0 100px;
    border-top: 1px solid var(--border-color);
}

.faq-accordion {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.faq-item[open] {
    border-color: var(--border-hover);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.6), 0 0 10px var(--primary-glow);
}

.faq-question {
    padding: 20px 24px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none; /* Hide default browser marker */
    user-select: none;
}

/* Hide webkit default arrow */
.faq-question::-webkit-details-marker {
    display: none;
}

.faq-arrow {
    width: 20px;
    height: 20px;
    stroke: var(--text-muted);
    transition: transform 0.3s ease;
}

.faq-item[open] .faq-arrow {
    transform: rotate(180deg);
    stroke: var(--primary);
}

.faq-question:hover {
    color: var(--primary);
}

.faq-question:hover .faq-arrow {
    stroke: var(--primary);
}

.faq-answer {
    padding: 20px 24px 20px;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    animation: fadeIn 0.4s ease;
}

.faq-answer p {
    margin-bottom: 0;
}

.faq-answer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.faq-answer a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar for Prompt Box */
.prompt-box::-webkit-scrollbar {
    width: 6px;
}

.prompt-box::-webkit-scrollbar-track {
    background: transparent;
}

.prompt-box::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.prompt-box::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .generator-grid {
        grid-template-columns: 1fr;
    }
    .preview-panel {
        position: static;
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .app-header h1 {
        font-size: 1.8rem;
    }
    .products-grid {
        grid-template-columns: 1fr;
    }
    .tabs-nav {
        justify-content: flex-start;
    }
}
