:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --success-color: #10b981;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    padding: 20px;
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo h1 span {
    color: var(--primary-color);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Layout Grid */
.grid-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
}

@media (max-width: 850px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

.card h2 i {
    color: var(--primary-color);
}

/* Guide List */
.guide-list {
    list-style: none;
}

.guide-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.guide-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.guide-list code {
    background: #f1f5f9;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    color: #e11d48;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    border: 2px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f5f3ff;
}

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

.btn-success:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-large {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-muted);
    text-decoration: underline;
    cursor: pointer;
    margin-top: 15px;
    width: 100%;
}

.template-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Upload Drop Zone */
.drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
    text-align: center;
}

.drop-zone i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.drop-zone:hover, .drop-zone.active {
    border-color: var(--primary-color);
    background-color: #f5f3ff;
}

.drop-zone.has-file {
    border-color: var(--success-color);
    background-color: #ecfdf5;
}

.drop-zone.has-file i {
    color: var(--success-color);
}

/* Result Card */
.result-card {
    text-align: center;
    border: 2px solid var(--success-color);
    animation: slideIn 0.3s ease-out;
}

.status-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.status-icon.success {
    color: var(--success-color);
}

/* Loading Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--primary-color);
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.hidden {
    display: none !important;
}

footer {
    margin-top: 50px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding-bottom: 30px;
}

/* Format Guide Styles */
.help-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.format-preview {
    background: #f1f5f9;
    padding: 10px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.85rem;
    color: #0f172a;
    margin: 8px 0;
    white-space: pre-wrap;
    border-left: 3px solid var(--primary-color);
    text-align: left;
}

.badge {
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Accordion/Details Styles */
details {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
}

details[open] {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.05);
}

summary {
    padding: 12px 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    color: var(--text-main);
    font-size: 0.92rem;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

details[open] summary::after {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.details-content {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.details-content h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    margin-top: 12px;
    color: var(--primary-color);
}

.details-content h4:first-child {
    margin-top: 0;
}

/* Form Category Input Styles */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--text-main);
}

.form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s ease;
}

.form-group input[type="text"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-group input[type="text"]::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Error Card & Error Details */
.error-card {
    text-align: center;
    border: 2px solid #ef4444;
    animation: slideIn 0.3s ease-out;
}

.status-icon.error {
    color: #ef4444;
}

.error-box {
    background-color: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
}

#errorMsg {
    color: #b91c1c;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1rem;
}

.error-detail {
    background: #1e293b;
    color: #f1f5f9;
    padding: 12px;
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: pre-wrap;
    max-height: 200px;
    margin: 0;
}

/* Language Switcher */
.lang-switcher-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
    padding-top: 10px;
}

.lang-switcher {
    display: inline-flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 6px 16px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}


/* Ad Placeholders */
.ad-placeholder {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    margin: 20px 0;
    padding: 10px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.ad-placeholder:hover {
    border-color: var(--primary-color);
    background-color: #f5f3ff;
}

.ad-placeholder::before {
    content: "SPONSORED ADVERTISEMENT";
    font-size: 0.65rem;
    letter-spacing: 1px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.ad-placeholder.leaderboard {
    width: 100%;
    min-height: 90px;
    margin: 10px 0 25px 0;
}

.ad-placeholder.sidebar {
    min-height: 250px;
    margin-top: 15px;
}

.ad-placeholder.post-conversion {
    min-height: 250px;
    margin: 20px auto 0 auto;
    max-width: 336px;
    border-color: var(--success-color);
}

/* Sticky Footer Ad */
.sticky-footer-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
    z-index: 999;
    padding: 10px;
    border-top: 2px solid var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
    animation: slideUp 0.4s ease-out;
}

.sticky-footer-ad .ad-placeholder {
    margin: 0;
    width: 728px;
    max-width: 100%;
    min-height: 90px;
    border-radius: 8px;
}

.close-ad-btn {
    position: absolute;
    top: -12px;
    right: 20px;
    background: #334155;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s;
}

.close-ad-btn:hover {
    background: #0f172a;
    transform: scale(1.1);
}

/* Loading Ad Banner */
.loading-ad-banner {
    width: 100%;
    max-width: 336px;
    min-height: 250px;
    margin-top: 25px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Add extra padding to body to prevent footer ad from covering footer content */
body {
    padding-bottom: 120px !important;
}

/* Content Rich & FAQ Layouts */
.content-rich-card, .faq-card {
    grid-column: 1 / -1;
    margin-top: 10px;
}

.content-rich-card h3 {
    font-size: 1.15rem;
    color: var(--primary-color);
    margin-top: 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-rich-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.content-rich-card ol {
    margin-left: 20px;
    margin-bottom: 15px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.content-rich-card ol li {
    margin-bottom: 8px;
}

/* Vignette Overlay (Full-screen Interstitial) */
.vignette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    color: #ffffff;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.vignette-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
}

.vignette-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.vignette-header h3 {
    color: var(--text-main);
    font-size: 1.15rem;
    margin: 0;
}

.skip-btn {
    background: #f1f5f9;
    border: none;
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: not-allowed;
    opacity: 0.6;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.skip-btn.ready {
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    opacity: 1;
}

.skip-btn.ready:hover {
    background: var(--primary-hover);
}

.vignette-ad-slot {
    width: 100%;
    min-height: 280px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 15px;
}

.vignette-ad-slot::before {
    content: "INTERSTITIAL ADVERTISEMENT";
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    color: #94a3b8;
    margin-bottom: 10px;
}

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

/* Navigation Bar */
.nav-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    background: var(--card-bg);
    padding: 8px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 0.95rem;
}

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

.nav-link.active {
    color: white;
    background: var(--primary-color);
}




