:root {
    --primary: #818cf8;
    --primary-glow: rgba(129, 140, 248, 0.4);
    --bg-dark: #020617;
    --sidebar-bg: rgba(15, 23, 42, 0.8);
    --card-bg: rgba(30, 41, 59, 0.5);
    --text: #f8fafc;
    --text-dim: #94a3b8;
    --accent: #c084fc;
    --aura-1: #4f46e5;
    --aura-2: #db2777;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
}

/* Glow Background */
.glow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(120px);
}

.aura {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    opacity: 0.3;
}

.aura-1 {
    background: var(--aura-1);
    top: -200px;
    right: -100px;
    animation: pulse 15s infinite alternate;
}

.aura-2 {
    background: var(--aura-2);
    bottom: -100px;
    left: 10%;
    animation: pulse 12s infinite alternate-reverse;
}

@keyframes pulse {
    from { transform: scale(1) translate(0, 0); }
    to { transform: scale(1.2) translate(100px, 50px); }
}

/* App Shell */
.app-shell {
    display: flex;
    height: 100vh;
    backdrop-filter: blur(20px);
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 2.5rem 1.5rem;
}

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

.logo-icon { font-size: 1.5rem; }
.logo-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.history-section h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    max-height: 400px;
    padding-right: 5px;
}

/* Custom Scrollbar for History */
.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.history-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary);
    transform: translateX(8px);
}

.history-platform {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.history-idea {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.empty-history {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-style: italic;
    opacity: 0.6;
}

.api-key-badge {
    margin-top: auto;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    text-align: center;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Workspace */
.workspace {
    flex: 1;
    padding: 3rem 4rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.workspace-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 500;
}

.tone-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tone-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 0.5rem 1.25rem;
    border-radius: 0.85rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tone-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Input Area */
.input-area {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

#ideaInput {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 1.25rem;
    resize: none;
    height: 120px;
    line-height: 1.6;
}

.platform-toggles {
    display: flex;
    gap: 1rem;
}

.platform-chip {
    cursor: pointer;
}

.platform-chip input { display: none; }
.platform-chip span {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.6rem 1.25rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    color: var(--text-dim);
    transition: all 0.2s;
}

.platform-chip input:checked + span {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 1.25rem;
    border-radius: 1.25rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px var(--primary-glow);
}

/* Results Area */
.results-area {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.results-placeholder {
    text-align: center;
    padding: 5rem;
    border: 2px dashed rgba(255, 255, 255, 0.05);
    border-radius: 2rem;
    color: var(--text-dim);
}

.result-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 2rem;
    animation: slideIn 0.5s ease out;
}

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

.result-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.result-tag {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 2px;
    font-weight: 700;
    color: var(--accent);
}

.result-content {
    font-size: 1.1rem;
    line-height: 1.7;
    white-space: pre-wrap;
    margin-bottom: 2rem;
}

.result-actions {
    display: flex;
    gap: 1rem;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

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

/* Loader */
.loader {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
.btn-loading .btn-text { display: none; }
.btn-loading .loader { display: block; }
