/* Shared Dashboard Styles - Used by Both Products */

/* Custom styles for main dashboard */
body {
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    height: 100vh;
}

/* Background elements */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        url('/img/pattern.svg'),
        radial-gradient(circle at 20% 30%, rgba(34, 197, 94, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(248, 250, 252, 0.01) 100%);
    background-size: 200px 200px, cover, cover, cover, cover;
    background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat;
    opacity: 0.3;
    z-index: -1;
}

/* Header styling */
.dashboard-header {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
}

/* Sidebar navigation */
.sidebar {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 72px; /* Height of header */
    left: 0;
    height: calc(100vh - 72px);
    overflow-y: auto;
}

.nav-item {
    position: relative;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: var(--bg-secondary);
}

.nav-item.active {
    background: var(--primary-50);
    border-left: 3px solid var(--primary-500);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-primary);
}

/* Upload area styling */
.upload-zone {
    background: var(--bg-secondary);
    border: 2px dashed var(--border-medium);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

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

.upload-zone.dragover {
    background: var(--primary-50);
    border-color: var(--primary-500);
    transform: scale(1.02);
}

.upload-zone.upload-disabled {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
    opacity: 0.5;
}

.upload-zone.upload-disabled:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
    transform: none;
}

/* Progress bar styling */
.progress-container {
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    background: var(--gradient-primary);
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Accordion styling */
.accordion-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    margin-bottom: var(--space-2);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s ease;
}

.accordion-header {
    padding: var(--space-4);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.accordion-header:hover {
    background: var(--bg-tertiary);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 var(--space-4);
}

.accordion-content.active {
    max-height: 1000px;
    padding: 0 var(--space-4) var(--space-4);
}

.accordion-icon.rotate {
    transform: rotate(180deg);
}

/* Results styling */
.result-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    transition: all 0.3s ease;
}

.result-item:hover {
    background: var(--bg-tertiary);
    transform: none;
}

/* Button styling */
.btn-primary {
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Chart container */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Credit indicator styles */
.credit-indicator {
    transition: all 0.3s ease;
}

.credit-indicator.sufficient {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #059669;
}

.credit-indicator.insufficient {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #dc2626;
}

.credit-indicator.checking {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    border-color: #1e40af;
}

/* Highlight animation for insufficient credits */
@keyframes highlightPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    }
}

.highlight-credits {
    animation: highlightPulse 2s ease-in-out infinite;
}

/* Error message positioning */
.fixed {
    position: fixed !important;
}

/* Process button danger state */
.btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-color: #b91c1c;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    border-color: #991b1b;
}

/* Hero Split Signals Grid Styles */
.signals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

@media (min-width: 768px) {
    .signals-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.signal-item {
    text-align: center;
    padding: var(--space-6);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-xl);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.signal-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.signal-item i {
    display: block;
    font-size: 2.5rem;
    margin-bottom: var(--space-3);
}

.signal-item h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

/* Fit Badges */
.fit-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.fit-badge.bg-green-100 {
    background-color: rgba(34, 197, 94, 0.15);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.fit-badge.bg-yellow-100 {
    background-color: rgba(245, 158, 11, 0.15);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.fit-badge.bg-red-100 {
    background-color: rgba(239, 68, 68, 0.15);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Preview Button Positioning */
.preview-btn {
    position: relative !important;
    z-index: 10;
    box-shadow: var(--shadow-lg) !important;
}

.preview-btn:hover {
    box-shadow: var(--shadow-xl) !important;
}

/* Loading Spinner for History */
.history-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-500);
    animation: spin 1s ease-in-out infinite;
}

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

/* File preview animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-preview-enter {
    animation: slideIn 0.3s ease-out;
}

/* Success animation */
@keyframes success-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.success-animation {
    animation: success-pulse 2s infinite;
}

/* Loading animation */
.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid var(--primary-500);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

/* Badge component */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-success {
    background: var(--primary-100);
    color: var(--primary-800);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.badge-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info);
}

/* Progress bar component */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-fast);
}

/* Error message auto-hide animation */
.error-auto-hide {
    animation: errorFadeOut 2.5s forwards;
}

@keyframes errorFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    60% {
        opacity: 1;
        transform: translateY(0);
    }
    80% {
        opacity: 0.5;
        transform: translateY(-10px);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
        visibility: hidden;
    }
}