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

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #64748b;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --bg-dark: #0f172a;
    --bg-medium: #1e293b;
    --bg-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #475569;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 350px;
    background: var(--bg-medium);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-dark);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Generation Section */
.generation-section {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.generation-section h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

/* Projects Section */
.projects-section {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.projects-section h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-item {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s;
}

.project-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

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

.project-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.btn-delete {
    background: var(--danger-color);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.project-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.project-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.page-btn {
    padding: 6px 12px;
    background: var(--bg-medium);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.page-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 40px 20px;
}

/* Content Area */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
}

.content-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-medium);
}

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

.content-actions {
    display: flex;
    gap: 10px;
}

/* Dashboard Container */
.dashboard-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    overflow: auto;
    background: var(--bg-dark);
}

.dashboard-frame {
    width: 1280px;
    height: 720px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.dashboard-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Welcome Message */
.welcome-message {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    text-align: center;
    color: var(--bg-medium);
}

.welcome-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.welcome-message h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--bg-dark);
}

.welcome-message p {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-bottom: 30px;
}

.welcome-message ul {
    text-align: left;
    list-style-position: inside;
    color: var(--secondary-color);
    font-size: 0.95rem;
    line-height: 1.8;
}

.welcome-message ul li {
    margin-bottom: 8px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-content p {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.loading-detail {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 300px;
    }

    .dashboard-frame {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

.ideas-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.ideas-link:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 0;
    background: var(--bg-dark);
    border-bottom: 2px solid var(--border-color);
    padding: 0 20px;
}

.tab-btn {
    padding: 16px 32px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    top: 2px;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-medium);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--bg-medium);
}

.tab-content {
    display: none;
    flex: 1;
}

.tab-content.active {
    display: flex;
}

.tab-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    text-align: center;
}

.tab-placeholder h2 {
    font-size: 2rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.tab-placeholder p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Adjust container for tabs */
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#tab-dashboards {
    display: flex;
}
