/* ================================
   PERSONAL AI DASHBOARD - STYLES
   ================================ */

/* CSS Variables for Theming */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f3f5;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius: 12px;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-tertiary: #374151;
    --text-primary: #f7fafc;
    --text-secondary: #a0aec0;
    --border-color: #4a5568;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 2rem 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    margin-bottom: 3rem;
    color: white;
    overflow: hidden;
}

.logo-image {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    max-width: 48px;
    max-height: 48px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    object-fit: cover;
    flex-shrink: 0;
}

.logo-image:hover {
    transform: scale(1.05);
}

.logo h2 {
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo i {
    font-size: 2rem;
}

.nav-links {
    list-style: none;
}

.nav-links li {
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links li:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-links li.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
}

.nav-links li.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: white;
}

.nav-links i {
    font-size: 1.2rem;
    width: 24px;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--bg-secondary);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    z-index: 999;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-tertiary);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    width: 400px;
}

.search-bar i {
    color: var(--text-secondary);
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    font-weight: 600;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}

/* Content Sections */
.content-section {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

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

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

.section-header h1 {
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-header i {
    color: var(--primary-color);
}

.section-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Chat Container */
.chat-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    height: calc(100vh - var(--header-height) - 6rem);
}

.chat-sidebar {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    overflow-y: auto;
}

.chat-sidebar h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.chat-history {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-item {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.chat-item:hover {
    background: var(--primary-color);
    color: white;
}

.chat-item.active {
    background: var(--primary-color);
    color: white;
}

.chat-item i {
    font-size: 1.2rem;
}

.chat-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.chat-info p {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Chat Main Area */
.chat-main {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.message {
    display: flex;
    gap: 1rem;
    max-width: 80%;
}

.message.assistant {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-content {
    background: var(--bg-tertiary);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    line-height: 1.6;
}

.message.user .message-content {
    background: var(--primary-color);
    color: white;
}

/* Chat Input */
.chat-input-container {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

#chat-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    margin-bottom: 1rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

#chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chat-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Knowledge Management */
.knowledge-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-card i {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-info h3 {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

/* File Manager */
.file-manager {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
}

.file-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

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

.file-card {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s ease;
}

.file-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.file-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.file-icon.pdf { background: #ef4444; }
.file-icon.doc { background: #3b82f6; }
.file-icon.img { background: #10b981; }

.file-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.file-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

/* Image Tools */
.image-tools {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
}

.tool-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 1rem 2rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary-color);
}

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

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: var(--bg-tertiary);
}

.upload-zone i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-zone h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.upload-zone p {
    color: var(--text-secondary);
}

/* Conversion Options */
.conversion-options {
    margin: 2rem 0;
}

.format-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.format-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

/* Design Studio */
.design-workspace {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    height: calc(100vh - var(--header-height) - 8rem);
}

.design-toolbar {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-btn {
    width: 50px;
    height: 50px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

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

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

.toolbar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.design-canvas-container {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#design-canvas {
    background: white;
    box-shadow: var(--shadow);
    max-width: 100%;
    max-height: 100%;
}

.design-properties {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    width: 280px;
}

.design-properties h3 {
    margin-bottom: 1.5rem;
}

.property-group {
    margin-bottom: 1.5rem;
}

.property-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.property-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
}

.property-group input[type="range"] {
    width: 100%;
}

/* Media Editor */
.media-editor {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
}

.media-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.video-upload-zone {
    text-align: center;
    padding: 4rem 2rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
}

.video-upload-zone i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.video-timeline {
    margin-top: 2rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.timeline-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.timeline-time {
    margin-left: auto;
    font-weight: 600;
}

.timeline-track {
    height: 60px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.video-tools {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* Photo Editor */
.photo-editor-workspace {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 1.5rem;
    height: 600px;
}

.editor-sidebar {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.editor-sidebar h3 {
    margin-bottom: 1.5rem;
}

.adjustment-control {
    margin-bottom: 1.5rem;
}

.adjustment-control label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.adjustment-control input[type="range"] {
    width: 100%;
}

.editor-canvas {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Filters Grid */
.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
}

.filter-item {
    cursor: pointer;
    text-align: center;
}

.filter-preview {
    width: 100%;
    height: 150px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.filter-item:hover .filter-preview {
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

/* Files Section */
.files-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.files-tree {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.files-tree h3 {
    margin-bottom: 1rem;
}

.folder-list {
    list-style: none;
}

.folder-list li {
    padding: 0.75rem;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.folder-list li:hover {
    background: var(--bg-tertiary);
}

.folder-list li.active {
    background: var(--primary-color);
    color: white;
}

.files-list {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
}

.files-table thead th {
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
}

.files-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.files-table tbody tr:hover {
    background: var(--bg-tertiary);
}

/* Settings */
.settings-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.settings-sidebar {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.settings-tab {
    width: 100%;
    padding: 1rem;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.settings-tab:hover {
    background: var(--bg-tertiary);
}

.settings-tab.active {
    background: var(--primary-color);
    color: white;
}

.settings-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
}

.settings-panel h2 {
    margin-bottom: 2rem;
}

.setting-item {
    margin-bottom: 2rem;
}

.setting-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.setting-item select,
.setting-item input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    .main-content {
        margin-left: 0;
    }

    .chat-container,
    .files-container,
    .settings-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .search-bar {
        width: 200px;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .files-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading & Animations */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    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); }
}

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

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

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

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