/* Premium "Deep Future" Design System - productivity/style.css */

:root {
    /* Deep Space Palette */
    --bg-deep: #030712;
    /* Very dark blue/black */
    --bg-surface: rgba(17, 24, 39, 0.6);
    --bg-surface-hover: rgba(31, 41, 55, 0.7);

    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-accent: #60a5fa;

    /* Brand Gradients */
    --brand-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    /* Indigo to Purple */
    --accent-glow: rgba(99, 102, 241, 0.5);

    --border-glass: rgba(255, 255, 255, 0.08);
    --border-active: rgba(168, 85, 247, 0.5);

    /* Spacing */
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 3rem;

    /* Typography */
    --font-display: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
    background-color: var(--bg-deep);
    /* Subtle background ambient glow matches "BrainMed+" style */
    background-image:
        radial-gradient(circle at 15% 50%, rgba(79, 70, 229, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.08), transparent 25%);
    color: var(--text-primary);
    font-family: var(--font-display);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Layout --- */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
    width: 100%;
}

/* Header */
.header {
    margin-bottom: var(--space-xl);
    position: relative;
    padding-left: var(--space-md);
}

.header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 4px;
    background: var(--brand-gradient);
    border-radius: 2px;
}

.header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: var(--space-sm);
    letter-spacing: -1px;
    /* Gradient Text */
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 400;
}

/* --- Navigation / Back Button --- */
.nav-bar {
    padding: var(--space-md) 0;
    margin-bottom: var(--space-lg);
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
}

.back-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

/* --- Universal Navigation --- */
.prod-nav-container {
    position: sticky;
    top: var(--space-md);
    z-index: 100;
    margin-bottom: var(--space-xl);
    display: flex;
    justify-content: center;
}

.prod-nav {
    background: rgba(17, 24, 39, 0.85);
    /* Slightly more opaque for readability */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 100px;
    /* Pill shape */
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.15);
    /* Indigo tint */
    color: #a5b4fc;
    /* Indigo-200 */
    border-color: rgba(99, 102, 241, 0.3);
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border-glass);
    margin: 0 4px;
}

.nav-home-icon {
    font-size: 1.2rem;
}

/* Hide old back link if present */
.back-link {
    display: none;
}

/* --- Premium Grid --- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Premium Glassmorphic Tile */
.tool-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 2rem;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
}

/* Hover State - "Lift & Glow" */
.tool-card:hover {
    transform: translateY(-8px);
    background: var(--bg-surface-hover);
    border-color: rgba(168, 85, 247, 0.3);
    /* Purple tint on border */
    box-shadow:
        0 20px 40px -10px rgba(0, 0, 0, 0.6),
        0 0 30px -10px rgba(99, 102, 241, 0.2);
    /* Indigo ambient glow */
}

/* Inner Glow Effect */
.tool-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.05), transparent 60%);
    pointer-events: none;
}

.tool-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    transition: all 0.3s;
}

.tool-card:hover .tool-icon-wrapper {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    border-color: rgba(168, 85, 247, 0.4);
    transform: scale(1.05);
}

.tool-title {
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.tool-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* --- Form Elements for Tools --- */
.form-section,
.output-section {
    background: rgba(10, 10, 10, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: var(--space-lg);
    margin-top: var(--space-lg);
}

.section-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #64748b;
    /* Slate-500 */
    margin-bottom: var(--space-md);
    display: block;
}

.premium-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: var(--space-md);
    border-radius: 12px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    transition: all 0.3s;
}

textarea.premium-input {
    height: 160px;
    resize: vertical;
}

input.premium-input {
    height: 48px;
}

.premium-input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.5);
    border-color: #6366f1;
    /* Indigo-500 */
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Responsive Nav Overrides */
@media (max-width: 1024px) {
    .prod-nav-container {
        padding: 0 var(--space-md);
    }
    
    .prod-nav {
        width: 100%;
        overflow-x: auto;
        padding: 12px;
        justify-content: flex-start;
        /* Hide scrollbar */
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }
    
    .prod-nav::-webkit-scrollbar {
        display: none;
    }
    
    .nav-item {
        white-space: nowrap;
        font-size: 0.8rem;
        padding: 8px 12px;
    }
}

textarea.premium-input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.5);
    border-color: #6366f1;
    /* Indigo-500 */
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.action-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: var(--space-md);
}

.btn-primary {
    background: var(--brand-gradient);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.4);
}

/* Code Output */
.code-block {
    background: #0b0f19;
    /* Very dark blue code bg */
    padding: var(--space-md);
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: #a5b4fc;
    /* Indigo-200 */
    overflow-x: auto;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

/* Copy Button */
.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.copy-btn {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #818cf8;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: #818cf8;
    color: #fff;
}

.copy-btn.success {
    background: #059669;
    /* Emerald-600 */
    border-color: #059669;
    color: #fff;
}

/* Preview Area */
.preview-block {
    margin-top: var(--space-md);
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    color: #333333;
}

/* Animations */
@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInSlide 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}