/**
 * Smart Alerts Styles
 * Extends style-v2.css for Smart Alerts and Trading Ideas pages
 */

/* Tab buttons */
.tab-btn {
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

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

/* Filter buttons */
.filter-btn {
    padding: var(--space-xs) var(--space-md);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.filter-btn:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-border-hover);
}

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

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent-primary), var(--color-accent-secondary));
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}

/* Status badges */
.badge {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-draft {
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}

.badge-active {
    background: #dbeafe;
    color: #1e40af;
}

.badge-position_entered {
    background: #fef3c7;
    color: #92400e;
}

.badge-completed {
    background: #d1fae5;
    color: #065f46;
}

.badge-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-triggered {
    background: #ddd6fe;
    color: #5b21b6;
}

.badge-expired {
    background: #f3f4f6;
    color: #6b7280;
}

/* Modal overrides for v2 design */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-md);
}

.modal-content {
    background: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: var(--color-bg-secondary);
    border: none;
    border-radius: var(--radius-full);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Timeline for check history */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #e2e8f0;
}

.timeline-item.info .timeline-dot { 
    border-color: #94a3b8; 
    background: #f1f5f9; 
}

.timeline-item.warning .timeline-dot { 
    border-color: #f59e0b; 
    background: #fef3c7; 
}

.timeline-item.triggered .timeline-dot { 
    border-color: #10b981; 
    background: #dcfce7; 
}

.timeline-item.expired .timeline-dot { 
    border-color: #64748b; 
    background: #f1f5f9; 
}

.timeline-item.cancelled .timeline-dot { 
    border-color: #64748b; 
    background: #f1f5f9; 
}

.timeline-item.error .timeline-dot { 
    border-color: #ef4444; 
    background: #fee2e2; 
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .modal-content {
        padding: var(--space-lg);
        max-height: 95vh;
    }
    
    .grid.grid-cols-2 {
        grid-template-columns: 1fr;
    }
}
