:root {
    --bg-color: #050505;
    --surface-color: rgba(24, 24, 27, 0.6);
    --text-main: #ffffff;
    --text-muted: #888893;
    --accent: #45f3ff; 
    --border: rgba(255, 255, 255, 0.08);
    --ui-element-color: rgba(255, 255, 255, 0.2);
    --ui-border-color: rgba(255, 255, 255, 0.3);
    --ui-text-color: #ffffff;
}

body.dark-ui-mode {
    --ui-element-color: rgba(0, 0, 0, 0.4);
    --ui-border-color: rgba(0, 0, 0, 0.6);
    --ui-text-color: #000000;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body { background-color: var(--bg-color); color: var(--text-main); min-height: 100vh; display: flex; justify-content: center; overflow-x: hidden; }

.app-background {
    position: fixed; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at 50% 30%, #15151e 0%, #050505 50%);
    z-index: -1; pointer-events: none;
}

.app-container { width: 100%; max-width: 1200px; padding: 2.5rem 1rem; display: flex; flex-direction: column; }
header { margin-bottom: 2rem; text-align: center; }
header h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); font-weight: 700; letter-spacing: -0.04em; }
header h1 span { color: var(--accent); }
header p { color: var(--text-muted); margin-top: 0.5rem; font-size: clamp(0.9rem, 3vw, 1.05rem); }

.workspace { display: flex; flex-direction: column; align-items: center; gap: 2rem; width: 100%; }
.controls-wrapper { display: flex; flex-direction: column; gap: 1.2rem; align-items: center; width: 100%; max-width: 800px; }

/* Controls Base */
.controls {
    display: flex; gap: 1rem; align-items: center; justify-content: center; flex-wrap: wrap;
    background: var(--surface-color); padding: 0.5rem; border-radius: 99px;
    border: 1px solid var(--border); backdrop-filter: blur(20px); width: 100%;
}

.platform-selector { display: flex; gap: 0.25rem; flex-wrap: wrap; justify-content: center; }
.platform-selector button {
    background: transparent; color: var(--text-muted); border: none; padding: 0.6rem 1rem;
    border-radius: 99px; cursor: pointer; font-size: 0.85rem; font-weight: 500; transition: 0.3s;
}
.platform-selector button:hover { color: var(--text-main); }
.platform-selector button.active { background: rgba(255, 255, 255, 0.1); color: var(--text-main); }

.upload-btn {
    display: flex; align-items: center; gap: 0.5rem; background: var(--text-main);
    color: var(--bg-color); padding: 0.6rem 1.5rem; border-radius: 99px;
    font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: 0.2s;
}
.upload-btn:hover { transform: scale(1.03); background: #e2e2e2;}

/* Live Caption Tester Input */
.caption-tester { width: 100%; max-width: 600px; }
.caption-tester input {
    width: 100%; background: rgba(24, 24, 27, 0.4); border: 1px solid var(--border);
    color: white; padding: 0.8rem 1.2rem; border-radius: 16px; font-size: 0.9rem;
    outline: none; transition: all 0.3s ease; backdrop-filter: blur(10px);
}
.caption-tester input:focus { border-color: rgba(69, 243, 255, 0.5); box-shadow: 0 0 15px rgba(69, 243, 255, 0.15); }
.caption-tester input::placeholder { color: rgba(255,255,255,0.3); }

/* Pro Tools UI */
.pro-tools { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; justify-content: center; width: 100%;}
.pro-badge { font-size: 0.7rem; font-weight: 700; color: var(--accent); letter-spacing: 1px; }
.pro-tools button {
    background: transparent; border: 1px solid var(--border); color: var(--text-muted);
    padding: 0.5rem 0.8rem; border-radius: 10px; font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: 0.3s;
}
.pro-tools button:hover, .pro-tools button.active { background: rgba(255,255,255,0.08); color: white; border-color: rgba(255,255,255,0.3); }

/* Download Group & Info Btn */
.download-group { display: flex; gap: 0.4rem; align-items: center; }
.pro-tools button.premium-btn {
    background: linear-gradient(90deg, #45f3ff, #1ebbd7); color: #000; font-weight: 700; border: none; 
}
.pro-tools button.premium-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(69, 243, 255, 0.3); }
.pro-tools button.info-btn { 
    background: rgba(255,255,255,0.1); border: 1px solid var(--border); border-radius: 50%;
    width: 32px; height: 32px; display: flex; justify-content: center; align-items: center;
    padding: 0; font-weight: bold; font-family: monospace; font-size: 1rem;
}
.pro-tools button.info-btn:hover { background: rgba(255,255,255,0.2); }

/* Modal Styles */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center;
    z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay.visible { opacity: 1; pointer-events: auto; }

.modal-content {
    background: #111115; border: 1px solid rgba(255,255,255,0.1); border-radius: 24px;
    padding: 2rem; max-width: 450px; width: 90%; position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5); transform: translateY(20px); transition: transform 0.3s ease;
}
.modal-overlay.visible .modal-content { transform: translateY(0); }

.close-btn {
    position: absolute; top: 1rem; right: 1.5rem; background: none; border: none;
    color: var(--text-muted); font-size: 1.5rem; cursor: pointer; transition: 0.2s;
}
.close-btn:hover { color: white; }
.modal-content h2 { font-size: 1.3rem; margin-bottom: 0.2rem; }
.modal-subtitle { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.5rem; }

.modal-steps { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.step { display: flex; gap: 1rem; align-items: flex-start; }
.step-num { 
    background: rgba(69, 243, 255, 0.1); color: var(--accent); width: 28px; height: 28px; 
    border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 0.8rem; font-weight: bold; flex-shrink: 0; border: 1px solid rgba(69, 243, 255, 0.3);
}
.step p { font-size: 0.9rem; line-height: 1.4; color: #ddd; margin-top: 0.2rem;}
.step b { color: white; }

.got-it-btn {
    width: 100%; background: white; color: black; border: none; padding: 0.8rem;
    border-radius: 12px; font-weight: 600; cursor: pointer; transition: 0.2s;
}
.got-it-btn:hover { background: #e0e0e0; }

/* Device Notch */
.device-notch {
    position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
    width: 120px; height: 32px; background-color: #000; border-radius: 20px;
    z-index: 20; opacity: 0; pointer-events: none; transition: 0.3s ease;
    box-shadow: inset 0 0 4px rgba(255,255,255,0.2); 
}
.device-notch.visible { opacity: 1; }

/* Mockup Container Base */
.mockup-wrapper {
    width: 100%; max-width: 360px; padding: 0.6rem; border-radius: 40px;
    background: linear-gradient(145deg, rgba(255,255,255,0.15), rgba(255,255,255,0.02));
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.8); transition: all 0.3s ease;
}
.mockup-wrapper.drag-active { transform: scale(1.02); box-shadow: 0 0 40px rgba(69, 243, 255, 0.3); border: 1px solid rgba(69,243,255,0.3); }

.mockup-container {
    width: 100%; aspect-ratio: 9 / 16; background-color: #09090b;
    border-radius: 32px; position: relative; overflow: hidden; display: flex;
    justify-content: center; align-items: center; border: 1px solid rgba(255,255,255,0.05);
}

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 1rem; color: var(--text-muted); z-index: 15; pointer-events: none; }
.empty-state .upload-icon { width: 60px; height: 60px; border-radius: 50%; background: rgba(255,255,255,0.05); display: flex; justify-content: center; align-items: center; border: 1px dashed rgba(255,255,255,0.2); }
.mockup-container img, .mockup-container video { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; }

/* Grid */
.grid-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; opacity: 0; transition: opacity 0.3s; }
.grid-overlay.visible { opacity: 1; }
.grid-line { position: absolute; background: rgba(69, 243, 255, 0.5); box-shadow: 0 0 5px rgba(69, 243, 255, 0.8); }
.grid-line.v-1 { top: 0; bottom: 0; left: 33.33%; width: 1px; }
.grid-line.v-2 { top: 0; bottom: 0; left: 66.66%; width: 1px; }
.grid-line.h-1 { left: 0; right: 0; top: 33.33%; height: 1px; }
.grid-line.h-2 { left: 0; right: 0; top: 66.66%; height: 1px; }

/* Overlay UI */
.overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; display: flex; flex-direction: column; justify-content: space-between; padding: 24px 16px; opacity: 0; transition: all 0.4s ease; }
.overlay.visible { opacity: 1; }
.ui-top { text-align: center; font-size: 0.95rem; color: var(--ui-text-color); margin-top: 10px; }
.ui-right { position: absolute; right: 12px; bottom: 90px; display: flex; flex-direction: column; gap: 18px; align-items: center; transition: 0.3s; }
.ui-icon { width: 42px; height: 42px; background-color: var(--ui-element-color); border-radius: 50%; backdrop-filter: blur(5px); border: 1px solid var(--ui-border-color); display: block; }
.profile-pic { width: 46px; height: 46px; border: 2px solid var(--ui-text-color); margin-bottom: 8px; }
.ui-bottom { position: absolute; bottom: 20px; left: 16px; right: 70px; display: flex; flex-direction: column; gap: 10px; transition: 0.3s; color: var(--ui-text-color); }
.ui-username { font-weight: 600; font-size: 1.05rem; }
.ui-description { font-size: 0.9rem; line-height: 1.4; background-color: rgba(239, 68, 68, 0.4); padding: 6px 8px; border-radius: 6px; border: 1px dashed rgba(255,255,255,0.6); backdrop-filter: blur(4px); color: white; word-wrap: break-word;}
.ui-music { font-size: 0.85rem; display: block; }

/* --- 🌟 PLATFORM SPECIFIC OVERRIDES --- */

/* IG Reels */
.overlay.reels .ui-top { opacity: 0; } 
.overlay.reels .ui-right { bottom: 70px; } 
.overlay.reels .ui-icon:nth-child(5) { display: none; }

/* YouTube Shorts */
.overlay.shorts .ui-top { opacity: 0; } 
.overlay.shorts .ui-right { bottom: 60px; right: 16px; } 
.overlay.shorts .ui-bottom { bottom: 25px; }
.overlay.shorts .ui-icon:nth-child(4), 
.overlay.shorts .ui-icon:nth-child(5) { display: none; }

/* Facebook Reels */
.overlay.facebook .ui-top { opacity: 0; } 
.overlay.facebook .ui-right { bottom: 90px; gap: 12px; } 
.overlay.facebook .ui-bottom { bottom: 40px; }
.overlay.facebook .ui-icon:nth-child(4), 
.overlay.facebook .ui-icon:nth-child(5) { display: none; }

/* Snapchat Spotlight */
.overlay.snapchat .ui-top { opacity: 0; } 
.overlay.snapchat .ui-right { bottom: 130px; } 
.overlay.snapchat .ui-bottom { bottom: 160px; right: 20px; }
.overlay.snapchat .ui-icon:nth-child(4), 
.overlay.snapchat .ui-icon:nth-child(5),
.overlay.snapchat .ui-music { display: none !important; }
.overlay.snapchat .ui-description { padding: 12px; font-size: 1rem; }

/* --- 🚀 SEO Content Section --- */
.seo-content {
    width: 100%;
    max-width: 800px;
    margin: 4rem auto 2rem auto;
    padding: 0 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

.seo-content h2 {
    color: var(--text-main);
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.seo-content h3 {
    color: var(--text-main);
    font-size: 1.25rem;
    margin: 2.5rem 0 1rem;
}

.seo-content p {
    margin-bottom: 1rem;
}

.seo-content b {
    color: var(--text-main);
}

/* SEO Table */
.seo-table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.seo-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(24, 24, 27, 0.4);
    backdrop-filter: blur(10px);
    min-width: 500px;
}

.seo-table th, .seo-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.seo-table th {
    color: var(--text-main);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
}

.seo-table tr:last-child td {
    border-bottom: none;
}

/* SEO FAQ Accordion */
.seo-faq {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.seo-faq details {
    background: rgba(24, 24, 27, 0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem;
    transition: all 0.3s ease;
}

.seo-faq details:hover {
    background: rgba(255, 255, 255, 0.03);
}

.seo-faq summary {
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    outline: none;
}

.seo-faq summary::-webkit-details-marker {
    display: none;
}

.seo-faq summary::after {
    content: "+";
    color: var(--accent);
    font-size: 1.4rem;
    font-weight: 400;
    transition: transform 0.3s;
}

.seo-faq details[open] summary {
    margin-bottom: 1rem;
}

.seo-faq details[open] summary::after {
    content: "−";
}

@media (max-width: 768px) {
    .controls { flex-direction: column; border-radius: 16px; padding: 1rem; width: 100%; }
    .upload-btn { width: 100%; justify-content: center; }
    .mockup-wrapper { border-radius: 28px; padding: 0.5rem; max-width: 100%; margin: 0 auto; width: 90%; }
    .mockup-container { border-radius: 24px; }
}
