:root {
    /* Brand Colors - Modern Vivid Gradient Theme */
    --primary: #8B5CF6;
    --primary-hover: #7C3AED;
    --secondary: #EC4899;
    --accent: #06B6D4;

    /* Dark Atmosphere */
    --bg-base: #101014;
    --bg-sidebar: #15151A;
    --bg-panel: rgba(25, 25, 32, 0.6);
    --bg-card: #202028;
    --bg-card-hover: #2A2A35;
    --bg-input: #1C1C24;

    /* Text */
    --text-main: #F3F4F6;
    --text-muted: #9CA3AF;
    --text-subtle: #6B7280;

    /* structural */
    --border: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(139, 92, 246, 0.5);

    /* Status */
    --success: #10B981;
    --error: #EF4444;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --font-sans: 'Outfit', system-ui, sans-serif;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 50;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.logo-icon span {
    color: rgba(255, 255, 255, 0.7);
}

.logo h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    padding: 1.5rem 1rem;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-nav h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-subtle);
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
}

ul {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-icon {
    width: 18px;
    height: 18px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.mt-6 {
    margin-top: 2rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

/* Vault List */
.vault-list .nav-item {
    justify-content: space-between;
}

.vault-list .vault-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.vault-count {
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    border: 1px solid var(--border);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.main-content::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, rgba(20, 20, 25, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

.top-nav {
    padding: 1.25rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: rgba(16, 16, 20, 0.5);
    backdrop-filter: blur(20px);
    z-index: 10;
}

.top-nav h1 {
    font-size: 1.5rem;
    font-weight: 600;
    z-index: 10;
}

.mobile-menu-btn {
    display: none;
    cursor: pointer;
    color: var(--text-main);
    width: 24px;
    height: 24px;
}

.btn {
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
    outline: none;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.25);
}

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

.primary-btn:active {
    transform: translateY(1px);
}

.ghost-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.ghost-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.full-width {
    width: 100%;
}

/* Workspace Area */
.generator-layout {
    display: flex;
    flex-grow: 1;
    padding: 2.5rem;
    gap: 2.5rem;
    overflow-y: auto;
    z-index: 1;
}

/* Config Panel */
.config-panel {
    width: 400px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-self: flex-start;
}

.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

.required {
    color: var(--secondary);
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-subtle);
}

input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.1);
}

.tone-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.tone-btn {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.tone-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.tone-btn.active {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.sparkle-icon {
    width: 18px;
    height: 18px;
}

/* Results Panel */
.results-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.state-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    animation: fadeIn 0.4s ease;
}

.hero-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.state-container h3 {
    color: var(--text-main);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.state-container p {
    max-width: 400px;
    line-height: 1.6;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

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

/* Generated Copy Cards */
.results-container {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.results-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.results-header h2 {
    font-weight: 600;
    font-size: 1.25rem;
}

.badge {
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.copy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.copy-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    position: relative;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.copy-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.copy-text {
    font-size: 1.25rem;
    font-weight: 500;
    color: white;
    line-height: 1.4;
    word-break: break-word;
}

/* Specific styling for context visualization */
.copy-card[data-type="buttons"] .copy-text {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    align-self: flex-start;
}

.copy-card[data-type="errors"] .copy-text {
    color: var(--error);
}

.copy-card[data-type="success"] .copy-text {
    color: var(--success);
}

.copy-meta {
    font-size: 0.8rem;
    color: var(--text-subtle);
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: auto;
}

.card-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.copy-card:hover .card-actions {
    opacity: 1;
}

.action-btn {
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn svg {
    width: 14px;
    height: 14px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.action-btn.saved {
    color: var(--secondary);
    border-color: rgba(236, 72, 153, 0.3);
    background: rgba(236, 72, 153, 0.1);
}

.hidden {
    display: none !important;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 0.95rem;
    font-weight: 500;
}

.toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

.toast-icon {
    background: var(--success);
    color: var(--bg-base);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 900px) {
    .generator-layout {
        flex-direction: column;
        padding: 1.5rem;
    }

    .config-panel {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        height: 100vh;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-menu-btn {
        display: block;
    }

    .top-nav {
        padding: 1rem 1.5rem;
        gap: 1rem;
    }

    .top-nav h1 {
        font-size: 1.25rem;
    }
}