/* Dashboard Styles */

.dashboard-container {
    display: flex;
    min-height: calc(100vh - 80px);
}

/* Sidebar */
.dashboard-sidebar {
    width: 260px;
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
}

.sidebar-menu {
    flex: 1;
    padding: 24px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.menu-item.active {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.menu-item svg {
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--border);
}

/* Main Content */
.dashboard-main {
    flex: 1;
    padding: 40px;
    background: var(--bg-light);
    overflow-y: auto;
}

.dashboard-section {
    display: none;
}

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

.dashboard-section h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.section-subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-change {
    font-size: 13px;
    color: var(--text-muted);
}

.stat-change.positive {
    color: var(--success);
}

/* Quick Actions */
.quick-actions {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 40px;
}

.quick-actions h2 {
    margin-bottom: 24px;
    font-size: 1.5rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.action-card:hover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
}

.action-card svg {
    color: var(--primary);
}

.action-card span {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

/* Recent Activity */
.recent-activity {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.recent-activity h2 {
    margin-bottom: 24px;
    font-size: 1.5rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: 8px;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.activity-icon.success {
    background: #d4edda;
    color: #28a745;
}

.activity-icon.cached {
    background: #e6f3ff;
    color: #0066cc;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.activity-meta {
    font-size: 13px;
    color: var(--text-muted);
}

.activity-credits {
    font-weight: 600;
    color: var(--danger);
    font-size: 14px;
}

.activity-credits.cached {
    color: var(--success);
}

/* API Keys */
.api-keys-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
}

.api-key-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.api-key-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}

.api-key-header h3 {
    margin: 0 0 4px 0;
    font-size: 1.125rem;
}

.api-key-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: #d4edda;
    color: #28a745;
}

.api-key-value {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 12px;
}

.api-key-value code {
    flex: 1;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    color: var(--text-primary);
}

.btn-icon {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

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

.api-key-stats {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.api-key-actions {
    display: flex;
    gap: 12px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-danger {
    background: white;
    color: var(--danger);
    border: 2px solid var(--danger);
}

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

/* Placeholder Content */
.placeholder-content {
    background: white;
    padding: 80px 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.placeholder-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .dashboard-sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 12px 0;
    }
    
    .menu-item {
        flex-direction: column;
        gap: 4px;
        padding: 12px 16px;
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }
    
    .menu-item.active {
        border-left: none;
        border-bottom-color: var(--primary);
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .dashboard-main {
        padding: 24px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .menu-item span {
        display: none;
    }
    
    .action-card span {
        font-size: 12px;
    }
}
