/* Dashboard-specific styles */
/* services/frontend_ui/css/dashboard.css */

/* Dashboard Grid Animations */
.dashboard-grid .stat-card {
    animation: slideInUp 0.5s ease forwards;
    opacity: 0;
}

.dashboard-grid .stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.dashboard-grid .stat-card:nth-child(2) {
    animation-delay: 0.2s;
}

.dashboard-grid .stat-card:nth-child(3) {
    animation-delay: 0.3s;
}

.dashboard-grid .stat-card:nth-child(4) {
    animation-delay: 0.4s;
}

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

/* Recent Activity Table */
#recentActivity tr {
    animation: fadeIn 0.3s ease;
}

/* Dashboard specific stat card icons */
.stat-card::before {
    content: '';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    opacity: 0.2;
    background-size: contain;
}

/* Refresh indicator */
.refreshing {
    position: relative;
}

.refreshing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: inherit;
    animation: pulse 1s infinite;
}

/* Charts placeholder */
.chart-container {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 2rem;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-placeholder {
    text-align: center;
    opacity: 0.6;
}

.woo-insights-card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 2rem;
    position: relative;
}

.woo-insights-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.woo-insights-header h3 {
    margin: 0;
}

.woo-insights-subtitle {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.woo-insights-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.woo-insights-controls {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}

.woo-insights-controls label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.woo-insights-range {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.woo-insights-custom-range {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.woo-insights-custom-range.hidden {
    display: none;
}

.woo-insights-store-filters {
    flex: 1 1 260px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.woo-insights-store-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.woo-insights-series-toggle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    min-width: 180px;
}

.woo-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.woo-toggle input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
}

.woo-insights-store {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    color: inherit;
}

.woo-insights-store.active {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.15);
    color: white;
}

.woo-insights-store.inactive {
    opacity: 0.45;
}

.woo-insights-store .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
}

.woo-insights-store[data-status="ready"] .status-dot {
    background: var(--success);
}

.woo-insights-store[data-status="pending"] .status-dot,
.woo-insights-store[data-status="partial"] .status-dot {
    background: var(--warning);
}

.woo-insights-store[data-status="error"] .status-dot {
    background: var(--danger);
}

.woo-insights-store[data-refreshing="true"] {
    position: relative;
}

.woo-insights-store[data-refreshing="true"]::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

.woo-insights-store:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.12);
}

.woo-insights-store:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
}

.woo-insights-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.woo-insights-summary .summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 140px;
}

.woo-insights-summary .summary-item span {
    font-size: 0.85rem;
    color: var(--muted);
}

.woo-insights-summary .summary-item strong {
    font-size: 1.5rem;
}

.woo-insights-chart {
    position: relative;
    margin-top: 1.5rem;
    min-height: 320px;
}

.woo-insights-chart canvas {
    width: 100%;
    height: 100%;
}

.woo-insights-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(8, 15, 40, 0.65);
    backdrop-filter: blur(6px);
    border-radius: 12px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--muted);
    padding: 1.5rem;
}

.woo-insights-overlay.hidden {
    display: none;
}

.woo-insights-alert {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.9rem;
}

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

@media (max-width: 768px) {
    .woo-insights-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .woo-insights-range {
        flex-wrap: wrap;
    }

    .woo-insights-custom-range {
        flex-wrap: wrap;
    }
}

/* Activity timeline */
.activity-timeline {
    position: relative;
    padding-left: 2rem;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--glass-border);
}

.activity-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.5rem;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    border: 2px solid white;
}

/* Real-time indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--success);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--success);
}

.live-indicator::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.panels-grid {
    margin-top: 2rem;
}

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

.panel-card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.panel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.panel-card .card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.panel-card .card-header h3 {
    flex: 1;
    margin: 0;
    font-size: 1.2rem;
}

.panel-info {
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.info-label {
    opacity: 0.7;
}

.info-value {
    font-weight: 500;
}

.info-value.balance {
    color: var(--success);
    font-weight: bold;
}

.panel-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.7;
    text-transform: uppercase;
}

.panel-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.panel-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    padding: 0.5rem;
}

/* Services Modal */
.services-modal {
    max-height: 70vh;
    overflow-y: auto;
}

.modal-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.modal-toolbar .search-container {
    flex: 1;
}

.modal-toolbar .form-select {
    min-width: 150px;
}

.services-list {
    max-height: 500px;
    overflow-y: auto;
}

.service-category {
    margin-bottom: 2rem;
}

.category-header {
    background: var(--glass);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    font-weight: bold;
    border-left: 3px solid var(--primary);
}

.service-item {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.service-item:hover {
    transform: translateX(5px);
    border-color: var(--primary);
}

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

.service-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.service-features {
    display: flex;
    gap: 0.5rem;
}

.service-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    opacity: 0.9;
}

.service-detail {
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #000000;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Text color utilities */
.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

/* Form elements for panel forms */
.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    opacity: 0.7;
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.autocomplete-group {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(15, 23, 42, 0.2);
    border-radius: 0.5rem;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.35);
    max-height: 240px;
    overflow-y: auto;
    margin-top: 0.25rem;
    display: none;
    backdrop-filter: blur(12px);
    color: var(--text-primary, #f1f5f9);
}

.autocomplete-results.visible {
    display: block;
}

.autocomplete-item {
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: background 0.15s ease;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: rgba(59, 130, 246, 0.1);
}

.autocomplete-item.disabled {
    cursor: default;
    pointer-events: none;
    color: var(--text-muted);
}

.autocomplete-item-title {
    font-weight: 600;
    color: var(--text-primary);
}

.autocomplete-item-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
