/* ==============================================
   Dashboard Page Styles - Maya Neural Showcase
   ============================================== */

/* Page Views */
.page-view {
    padding: 1.5rem 2.5rem;
    background: transparent;
    min-height: 100%;
    width: 100%;
    align-self: flex-start;
}

.page-header {
    margin-bottom: 1rem;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
    font-weight: 700;
}

.page-header p {
    color: #6b7280;
    font-size: 1.0625rem;
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
}

.sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

.sidebar.collapsed .fleet-status span:not(.status-dot) {
    display: none;
}

.dashboard-container.sidebar-collapsed .main-dashboard-content {
    margin-left: 80px;
}

/* Live Agents Page */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1400px;
}

.agent-card {
    background: #f8f9fb;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.agent-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.agent-card:hover::before {
    opacity: 1;
}

.agent-card:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
    transform: translateY(-4px);
}

.agent-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.agent-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.agent-status-badge {
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agent-status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.agent-status-badge.busy {
    background: #fef3c7;
    color: #92400e;
}

.agent-status-badge.idle {
    background: #e5e7eb;
    color: #6b7280;
}

.agent-card h3 {
    font-size: 1.375rem;
    margin-bottom: 0.75rem;
    color: #1f2937;
    font-weight: 600;
}

.agent-description {
    color: #6b7280;
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.agent-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.25rem 0;
    background: transparent;
    margin-bottom: 1.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.agent-actions {
    display: flex;
    gap: 0.75rem;
}

.agent-actions button {
    flex: 1;
}

/* Memory Page */
.memory-container {
    max-width: 900px;
}

.memory-categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.memory-category {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #6b7280;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.memory-category:hover {
    border-color: #6366f1;
    color: #1f2937;
    background: #f8f9fb;
}

.memory-category.active {
    background: #eef2ff;
    border-color: #6366f1;
    color: #6366f1;
}

.memory-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.memory-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.memory-item:hover {
    border-color: #6366f1;
    background: #ffffff;
}

.memory-icon {
    width: 40px;
    height: 40px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1;
    flex-shrink: 0;
}

.memory-content {
    flex: 1;
}

.memory-content h4 {
    font-size: 1rem;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.memory-content p {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.memory-timestamp {
    font-size: 0.75rem;
    color: #9ca3af;
}

.memory-delete {
    background: rgba(239, 68, 68, 0.1);
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    color: #ef4444;
    transition: all 0.3s ease;
}

.memory-delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Security Page */
.security-container {
    max-width: 1000px;
}

.security-section {
    margin-bottom: 2.5rem;
}

.security-section h3 {
    font-size: 1.25rem;
    color: #1f2937;
    margin-bottom: 1.25rem;
    font-weight: 600;
}

.api-keys-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.api-key-item {
    background: #f8f9fb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.api-key-item:hover {
    border-color: #6366f1;
    background: #ffffff;
}

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

.api-key-header h4 {
    font-size: 1.125rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.api-key-value {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    color: #6b7280;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    display: inline-block;
}

.api-key-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.api-key-status.active {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.api-key-status.revoked {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.api-key-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

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

.security-settings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.security-setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #f8f9fb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.security-setting-item:hover {
    border-color: #6366f1;
    background: #ffffff;
}

.setting-info {
    flex: 1;
    margin-right: 1rem;
}

.setting-info h4 {
    font-size: 1rem;
    color: #1f2937;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.setting-info p {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: .3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #6366f1;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Activity Log */
.activity-log {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.activity-item:hover {
    border-color: #6366f1;
    background: #ffffff;
}

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

.activity-icon.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.activity-icon.warning {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.activity-content {
    flex: 1;
}

.activity-content p {
    color: #1f2937;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.activity-timestamp {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Settings Page */
.settings-container {
    max-width: 1200px;
}

.settings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.settings-tab {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.settings-tab:hover {
    color: #1f2937;
    background: #f8f9fb;
}

.settings-tab.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
}

.settings-section {
    margin-bottom: 2.5rem;
}

.settings-section h3 {
    font-size: 1.25rem;
    color: #1f2937;
    margin-bottom: 1.25rem;
    font-weight: 600;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
}

.setting-item label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.setting-select,
.setting-input {
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #1f2937;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.setting-select:hover,
.setting-input:hover {
    border-color: #6366f1;
}

.setting-select:focus,
.setting-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.setting-input:read-only {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8f9fb;
}

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

.integration-card {
    background: #f8f9fb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.integration-card:hover {
    border-color: #6366f1;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

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

.integration-logo {
    width: 48px;
    height: 48px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1;
}

.integration-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.integration-status.disconnected {
    background: #e5e7eb;
    color: #6b7280;
}

.integration-card h4 {
    font-size: 1.125rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.integration-card p {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Integrations List (New Design) */
.integrations-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.integration-category {
    display: flex;
    flex-direction: column;
}

.integration-category h3 {
    font-size: 1.125rem;
    color: #1f2937;
    margin-bottom: 1rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.integration-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.integration-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #f8f9fb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
    gap: 1rem;
}

.integration-item:hover {
    border-color: #6366f1;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}

.integration-info {
    flex: 1;
    min-width: 0;
}

.integration-info h4 {
    font-size: 1rem;
    color: #1f2937;
    margin-bottom: 0.125rem;
    font-weight: 600;
}

.integration-info p {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.4;
}

.integration-item .integration-status {
    white-space: nowrap;
}

.integration-item button {
    white-space: nowrap;
}

/* Button Styles */
.btn-primary,
.btn-secondary,
.btn-tertiary,
.btn-danger-outline {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: #6366f1;
    color: white;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

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

.btn-secondary {
    background: #ede9fe;
    color: #6366f1;
}

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

.btn-tertiary {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.btn-tertiary:hover {
    background: #e5e7eb;
    color: #374151;
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid #fca5a5;
    color: #dc2626;
}

.btn-danger-outline:hover {
    background: #fef2f2;
}

.btn-tertiary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .agents-grid,
    .integrations-grid {
        grid-template-columns: 1fr;
    }

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

    .page-view {
        padding: 1rem;
    }

    .sidebar {
        width: 60px;
    }

    .sidebar .logo-text,
    .sidebar .nav-item span,
    .sidebar .fleet-status span:not(.status-dot) {
        display: none;
    }

    .main-dashboard-content {
        margin-left: 60px;
    }

    .agent-stats {
        grid-template-columns: 1fr;
    }

    .api-key-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}
