/* Globals & Tokens */
:root {
    --bg-main: #0f111a;
    --bg-panel: rgba(25, 28, 41, 0.6);
    --border-glass: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    
    --accent-primary: #8b5cf6;
    --accent-hover: #7c3aed;
    
    --color-purple: #8b5cf6;
    --color-pink: #ec4899;
    --color-blue: #3b82f6;
    --color-green: #10b981;
    
    --sidebar-width: 260px;
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-theme {
    --bg-main: #f8fafc;
    --bg-panel: rgba(255, 255, 255, 0.8);
    --border-glass: rgba(0, 0, 0, 0.05);
    --text-primary: #0f172a;
    --text-secondary: #475569;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Background Gradients for Glassmorphism Context */
body::before {
    content: '';
    position: fixed;
    top: -50%; left: -20%;
    width: 60%; height: 100%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(0,0,0,0) 60%);
    z-index: -1;
    pointer-events: none;
}
body::after {
    content: '';
    position: fixed;
    bottom: -50%; right: -20%;
    width: 60%; height: 100%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.1) 0%, rgba(0,0,0,0) 60%);
    z-index: -1;
    pointer-events: none;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-panel);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-glass);
    display: flex; flex-direction: column;
    transition: var(--transition);
}

.logo {
    padding: 24px;
    font-size: 24px; font-weight: 700;
    display: flex; align-items: center; gap: 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-glass);
}
.logo i { color: var(--accent-primary); }

.nav-menu {
    flex: 1;
    padding: 24px 16px;
    display: flex; flex-direction: column; gap: 8px;
}

.nav-item {
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none; font-weight: 500;
    display: flex; align-items: center; gap: 12px;
    transition: var(--transition);
}
.nav-item:hover, .nav-item.active {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-primary);
}

.profile-section {
    padding: 20px;
    border-top: 1px solid var(--border-glass);
    display: flex; align-items: center; gap: 12px;
}
.avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--accent-primary);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 18px;
}
.user-info { display: flex; flex-direction: column; }
.user-info .name { font-weight: 600; font-size: 14px; }
.user-info .plan { font-size: 12px; color: var(--accent-primary); margin-top: 2px;}

/* Main Content */
.main-content {
    flex: 1;
    display: flex; flex-direction: column;
    overflow-y: auto;
}

.topbar {
    padding: 24px 40px;
    display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0;
    background: rgba(15, 17, 26, 0.8);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    z-index: 10;
    border-bottom: 1px solid var(--border-glass);
}
.light-theme .topbar { background: rgba(248, 250, 252, 0.8); }

.topbar h1 { font-size: 24px; font-weight: 700; }
.topbar-actions { display: flex; gap: 16px; align-items: center; }

/* Buttons Elements */
.btn {
    padding: 10px 20px;
    border-radius: 100px; border: none; font-weight: 600;
    cursor: pointer; font-size: 14px;
    display: inline-flex; align-items: center; gap: 8px;
    transition: var(--transition);
}
.btn-primary { background: var(--accent-primary); color: white; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4); transform: translateY(-2px); }
.btn-secondary { background: var(--border-glass); color: var(--text-primary); }
.btn-secondary:hover { background: rgba(255,255,255,0.15); }
.btn-upgrade { background: linear-gradient(135deg, #f59e0b, #ed8936); color: white; }
.btn-upgrade:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4); }

.btn-icon {
    width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--border-glass); background: var(--bg-panel);
    color: var(--text-primary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition);
}
.btn-icon:hover { background: var(--border-glass); }

/* Glass Card Global Class */
.glass-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius);
    padding: 32px;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}

/* Views specific styles */
.view-section {
    display: none; padding: 40px;
    animation: fadeIn 0.4s ease-out forwards;
}
.view-section.active { display: block; }

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

/* Dashboard Tools Grid */
.welcome-banner { margin-bottom: 32px; border-left: 4px solid var(--accent-primary); }
.welcome-banner h2 { font-size: 28px; margin-bottom: 8px; }
.welcome-banner p { color: var(--text-secondary); font-size: 16px; }

.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.tool-card { cursor: pointer; transition: var(--transition); position: relative; overflow: hidden; }
.tool-card:hover { transform: translateY(-5px); border-color: var(--accent-primary); box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.tool-icon {
    width: 50px; height: 50px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: white; margin-bottom: 20px;
}
.bg-purple { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.bg-pink { background: linear-gradient(135deg, #ec4899, #be185d); }
.bg-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.bg-green { background: linear-gradient(135deg, #10b981, #047857); }

.tool-card h3 { font-size: 18px; margin-bottom: 8px; }
.tool-card p { color: var(--text-secondary); font-size: 14px; line-height: 1.5; }

/* Layouts */
.split-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.single-layout { max-width: 800px; margin: 0 auto; }

/* Forms */
h3 i { margin-right: 12px; color: var(--accent-primary); }
.form-group { margin-bottom: 24px; margin-top: 24px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 14px; color: var(--text-secondary); }
input[type="text"], textarea, select {
    width: 100%; padding: 14px 16px; background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-glass); border-radius: 12px;
    color: var(--text-primary); font-size: 15px; outline: none; transition: var(--transition);
}
.light-theme input[type="text"], .light-theme textarea, .light-theme select { background: rgba(255,255,255,0.5); }
input:focus, textarea:focus, select:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2); }
textarea { resize: vertical; }

.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 300px; color: var(--text-secondary);
    border: 2px dashed var(--border-glass); border-radius: 12px;
    margin-top: 24px; text-align: center;
}
.empty-state i { margin-bottom: 16px; opacity: 0.5; }

/* Upload Area specific */
.upload-area {
    margin-top: 32px; border: 2px dashed var(--border-glass); border-radius: 16px;
    padding: 60px 20px; transition: var(--transition); cursor: pointer;
}
.upload-area:hover { border-color: var(--accent-primary); background: rgba(139, 92, 246, 0.05); }
.upload-area i { color: var(--accent-primary); margin-bottom: 16px; }

.mt-3 { margin-top: 16px; }
.text-center { text-align: center; }
.subtitle { color: var(--text-secondary); margin-top: 8px; font-size: 15px; }

/* Generated Content styling */
.generated-content-box {
    margin-top: 24px; padding: 24px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px; border-left: 4px solid var(--accent-primary);
    font-family: inherit; line-height: 1.6;
    animation: fadeIn 0.4s ease-out forwards;
}

.spinner {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3); border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
