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

:root {
    --bg-main: #090d16;
    --bg-card: rgba(17, 24, 39, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(124, 58, 237, 0.4);
    
    --primary: #7c3aed;
    --primary-glow: rgba(124, 58, 237, 0.15);
    --secondary: #06b6d4;
    --secondary-glow: rgba(6, 182, 212, 0.15);
    --accent: #ec4899;
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-inverse: #090d16;
    
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 25px 0 rgba(124, 58, 237, 0.25);
}

/* Base resets & layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Cosmic background lights */
body::before, body::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(60px);
}

body::before {
    top: -100px;
    left: -100px;
}

body::after {
    bottom: -100px;
    right: -100px;
}

/* Containers */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Header & Navigation */
header {
    background-color: rgba(9, 13, 22, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
}

.logo-icon {
    display: inline-block;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 8px;
    position: relative;
}

.logo-icon::after {
    content: '⇄';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--bg-main);
    font-weight: bold;
    font-size: 1.1rem;
}

nav {
    display: flex;
    gap: 16px;
}

@media (max-width: 992px) {
    .header-container {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }
    nav {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        white-space: nowrap;
        padding: 4px 0 8px 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    nav::-webkit-scrollbar {
        display: none;
    }
    .nav-link {
        padding: 6px 12px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
}

.nav-link.active {
    border-color: rgba(124, 58, 237, 0.3);
    background: radial-gradient(circle at top left, var(--primary-glow), transparent 70%);
}

/* Main content */
main {
    flex: 1;
    padding: 48px 0;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 48px;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 16px;
}

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

/* Tools Grid (Hub Page) */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.tool-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-main);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition-smooth);
}

.tool-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), var(--shadow-glow);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-icon {
    font-size: 2rem;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--primary);
    border: 1px solid var(--border-color);
}

.tool-card:hover .tool-icon {
    background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
    color: var(--text-main);
    border-color: var(--border-hover);
}

.tool-card h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.tool-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 24px;
}

.tool-btn {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--secondary);
    transition: var(--transition-smooth);
}

.tool-card:hover .tool-btn {
    color: var(--primary);
    transform: translateX(4px);
}

/* Ad Placeholders */
.ad-placeholder {
    background-color: rgba(22, 31, 48, 0.4);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 32px auto;
    padding: 16px;
    min-height: 90px;
    width: 100%;
    max-width: 728px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
}

.ad-sidebar {
    max-width: 300px;
    min-height: 250px;
}

/* Common Workspace Styles (Tool Pages) */
.workspace-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 992px) {
    .workspace-layout {
        grid-template-columns: 3fr 1fr;
    }
}

.workspace-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

/* File Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    background-color: rgba(255, 255, 255, 0.01);
    margin-bottom: 24px;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background-color: rgba(124, 58, 237, 0.03);
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.1);
}

.drop-zone-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--text-muted);
    display: inline-block;
    transition: var(--transition-smooth);
}

.drop-zone:hover .drop-zone-icon {
    color: var(--primary);
    transform: translateY(-4px);
}

.drop-zone h3 {
    margin-bottom: 8px;
    font-size: 1.25rem;
}

.drop-zone p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.drop-zone input[type="file"] {
    display: none;
}

.browse-btn {
    background: linear-gradient(135deg, var(--primary) 0%, rgba(124, 58, 237, 0.8) 100%);
    color: var(--text-main);
    padding: 10px 24px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

.browse-btn:hover {
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
}

/* File list / queue */
.file-list {
    margin-bottom: 24px;
}

.file-item {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-name {
    font-weight: 500;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.remove-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition-smooth);
    padding: 4px;
}

.remove-btn:hover {
    color: var(--error);
}

/* Form Controls & Selects */
.options-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.options-title {
    font-size: 1.05rem;
    margin-bottom: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group {
    margin-bottom: 16px;
}

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

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

select, input[type="text"], input[type="number"], textarea {
    width: 100%;
    background-color: rgba(9, 13, 22, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    outline: none;
}

select:focus, input[type="text"]:focus, input[type="number"]:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.2);
}

/* Action button */
.action-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.05rem;
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 28px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
}

.action-btn:hover {
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
}

.action-btn:disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Result / Status boxes */
.status-box {
    margin-top: 24px;
    border-radius: var(--radius-md);
    padding: 16px;
    display: none;
    align-items: center;
    gap: 12px;
}

.status-box.success {
    display: flex;
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #a7f3d0;
}

.status-box.error {
    display: flex;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.status-box.loading {
    display: flex;
    background-color: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: #ddd6fe;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Textarea specifically for CSV/JSON */
.data-editor {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .data-editor {
        grid-template-columns: 1fr 1fr;
    }
}

.editor-box {
    display: flex;
    flex-direction: column;
}

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

.editor-btn {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.editor-btn:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}

textarea.code-area {
    flex-grow: 1;
    font-family: monospace;
    font-size: 0.85rem;
    min-height: 350px;
    resize: vertical;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

/* Informational / SEO Text Section */
.seo-info {
    margin-top: 48px;
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.seo-info h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--text-main);
}

.seo-info h3 {
    font-size: 1.15rem;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--secondary);
}

.seo-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.seo-info p:last-child {
    margin-bottom: 0;
}

.seo-info ul {
    list-style-type: none;
    margin-left: 0;
    margin-bottom: 16px;
}

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

.seo-info li::before {
    content: '✓';
    color: var(--success);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Footer */
footer {
    background-color: rgba(9, 13, 22, 0.95);
    border-top: 1px solid var(--border-color);
    padding: 32px 0;
    margin-top: auto;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.footer-link:hover {
    color: var(--primary);
}

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

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