@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #080710;
    --bg-card: rgba(18, 18, 26, 0.7);
    --bg-card-hover: rgba(26, 26, 38, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(139, 92, 246, 0.4);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-blue: #3b82f6;
    
    --grad-primary: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --grad-glow: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);
    --grad-blue-purple: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Header & Navigation */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(8, 7, 16, 0.5);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.7rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Typography & Layouts */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.2px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 40px;
}

.demo-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 14px 20px;
    border-radius: var(--border-radius-md);
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: #fbd38d;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.05);
}

.demo-banner i {
    font-size: 1.1rem;
    color: #f59e0b;
}

.try-example-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-purple);
    cursor: pointer;
    transition: var(--transition-smooth);
    text-transform: none;
    letter-spacing: 0px;
}

.try-example-link:hover {
    color: var(--accent-pink);
    text-decoration: underline;
}

/* Grid System */
.workspace-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 30px;
    align-items: start;
}

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

/* Card / Panel Styling (Glassmorphism) */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

.panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* Input Fields & Buttons */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

textarea, input, select {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

textarea:focus, input:focus, select:focus {
    outline: none;
    border-color: var(--accent-purple);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* Tone & Option Pill Selectors */
.pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.pill-option {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.pill-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.pill-option.active {
    background: var(--grad-primary);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--grad-primary);
    color: white;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    transition: all 0.6s ease;
    pointer-events: none;
}

.btn-glow:hover::after {
    left: 120%;
    top: 120%;
}

.btn-icon {
    padding: 10px;
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

/* Studio Results Area */
.studio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.studio-tabs {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

.studio-tab {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
    background: transparent;
    transition: var(--transition-smooth);
}

.studio-tab.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-weight: 600;
}

/* Preview / Output Cards */
.output-workspace {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

@media (max-width: 1200px) {
    .output-workspace {
        grid-template-columns: 1fr;
    }
}

.editor-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.editor-textarea {
    min-height: 380px;
    font-size: 1.05rem;
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.2);
}

/* Preview Platforms */
.preview-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preview-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mock LinkedIn Post Card */
.mock-linkedin {
    background: #1d2226;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px;
    color: #e9e9e9;
    font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.9rem;
}

.linkedin-header {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.linkedin-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #3b82f6);
}

.linkedin-meta h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.linkedin-meta p {
    font-size: 0.75rem;
    color: #8f9296;
}

.linkedin-body {
    white-space: pre-wrap;
    line-height: 1.4;
    word-break: break-word;
}

/* Mock X (Twitter) Post Card */
.mock-x {
    background: #000000;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 16px;
    color: #e7e9ea;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.95rem;
}

.x-header {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
}

.x-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #ec4899);
}

.x-meta {
    display: flex;
    flex-direction: column;
}

.x-name {
    font-weight: 700;
    color: white;
    font-size: 0.9rem;
}

.x-handle {
    color: #71767b;
    font-size: 0.85rem;
}

.x-body {
    white-space: pre-wrap;
    line-height: 1.4;
}


/* Mock Instagram Card */
.mock-instagram {
    background: #000000;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.instagram-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.instagram-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.instagram-meta {
    display: flex;
    flex-direction: column;
}

.instagram-username {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
}

.instagram-location {
    font-size: 0.7rem;
    color: #a8a8a8;
}

.instagram-slide-container {
    aspect-ratio: 1/1;
    background: linear-gradient(135deg, #1d1b26 0%, #0d0c12 100%);
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.instagram-slide-content {
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.5;
    font-family: var(--font-heading);
}

.instagram-slide-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.instagram-actions {
    display: flex;
    gap: 12px;
    padding: 10px 0 6px 0;
    font-size: 1.15rem;
    color: white;
}

.instagram-likes {
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
}

.instagram-caption {
    font-size: 0.8rem;
    color: white;
    line-height: 1.4;
}

/* Mock TikTok/Shorts Portrait Container */
.mock-tiktok {
    background: #0f0f0f;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    aspect-ratio: 9/16;
    overflow: hidden;
    max-height: 480px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.tiktok-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, #111 0%, #000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.tiktok-bg::before {
    content: '';
    position: absolute;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.15) 0%, transparent 70%);
    animation: tiktok-pulse 8s infinite alternate;
}

@keyframes tiktok-pulse {
    0% { transform: scale(1) translate(-20px, -20px); }
    100% { transform: scale(1.3) translate(20px, 20px); }
}

.tiktok-camera-notch {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    z-index: 10;
}

.tiktok-overlay-content {
    position: relative;
    z-index: 5;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 70%, transparent 100%);
}

.tiktok-script-box {
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--border-radius-md);
    padding: 12px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    max-height: 160px;
    overflow-y: auto;
}

.tiktok-user {
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    margin-bottom: 4px;
}

.tiktok-desc {
    font-size: 0.75rem;
    color: #e5e7eb;
    margin-bottom: 8px;
}

.tiktok-music {
    font-size: 0.7rem;
    color: #a1a1aa;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #0f0e17;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 540px;
    padding: 30px;
    position: relative;
    transform: translateY(20px);
    transition: var(--transition-smooth);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.modal-backdrop.open .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

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

/* Pricing Layout inside Modal */
.pricing-header {
    text-align: center;
    margin-bottom: 24px;
}

.pricing-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pricing-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--accent-purple);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.pricing-badge {
    position: absolute;
    top: 15px;
    right: -30px;
    background: var(--grad-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 30px;
    transform: rotate(45deg);
    text-transform: uppercase;
}

.price {
    font-size: 2.5rem;
    font-family: var(--font-heading);
    font-weight: 800;
    margin: 15px 0;
    color: white;
}

.price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.features-list {
    list-style: none;
    margin: 20px 0;
}

.features-list li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.features-list li i {
    color: #10b981;
}

/* API Setup / Settings Styles */
.settings-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.4;
}

.settings-note a {
    color: var(--accent-purple);
    text-decoration: none;
}

.settings-note a:hover {
    text-decoration: underline;
}

/* History Sidebar / Section */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.history-item h5 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #10b981;
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    z-index: 1100;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition-smooth);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Loading Animation Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(8, 7, 16, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 90;
    border-radius: var(--border-radius-lg);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(139, 92, 246, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-purple);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 16px;
}

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

.loading-text {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
