/* PnL By Azzi Technologies - Common Styles */
/* Shared styles used across all pages */

/* ================================
   TOAST NOTIFICATIONS
   ================================ */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background: var(--white, #ffffff);
    border-radius: var(--radius-sm, 12px);
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: toastSlideIn 0.3s ease-out;
    border-left: 4px solid var(--accent, #6c63ff);
}

.toast.success {
    border-left-color: var(--success, #10b981);
}

.toast.error {
    border-left-color: var(--danger, #ef4444);
}

.toast.warning {
    border-left-color: var(--warning, #f59e0b);
}

.toast-icon {
    font-size: 1.25rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success, #10b981);
}

.toast.error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger, #ef4444);
}

.toast.warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning, #f59e0b);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: var(--text-dark, #2d3748);
}

.toast-message {
    font-size: 0.85rem;
    color: var(--text-light, #718096);
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted, #a0aec0);
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--text-dark, #2d3748);
}

.toast-exit {
    animation: toastSlideOut 0.3s ease-out forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ================================
   SHARED UTILITY CLASSES
   ================================ */

/* Loss row highlight in tables */
.loss-row {
    background-color: rgba(239, 68, 68, 0.05) !important;
}

/* Anomaly item types */
.anomaly-item.loss {
    border-left: 3px solid var(--danger, #ef4444);
}

.anomaly-item.low_margin {
    border-left: 3px solid var(--warning, #f59e0b);
}

/* Accessibility - Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for accessibility */
*:focus-visible {
    outline: 2px solid var(--accent, #6c63ff);
    outline-offset: 2px;
}

/* ================================
   LOADING & SPINNER
   ================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(224, 229, 236, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-secondary, #e8edf4);
    border-top: 4px solid var(--accent, #6c63ff);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-text {
    font-weight: 500;
    color: var(--text-dark, #2d3748);
    font-size: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ================================
   MOBILE MENU
   ================================ */
.nav-links.active {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(224, 229, 236, 0.98);
    backdrop-filter: blur(20px);
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    gap: 1rem;
    z-index: 1001;
}

.nav-links.active a {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(163, 177, 198, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links.active a:last-child {
    border-bottom: none;
}

.nav-links.active a::after {
    display: none;
}

/* ================================
   PLATFORM SELECTOR
   ================================ */
.platform-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.platform-btn {
    padding: 1rem 2rem;
    border: 2px solid var(--border, #e2e8f0);
    background: var(--white, #ffffff);
    border-radius: var(--radius-md, 20px);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}

.platform-btn:hover {
    border-color: var(--accent, #6c63ff);
    transform: translateY(-2px);
}

.platform-btn.active {
    border-color: var(--accent, #6c63ff);
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.05) 0%, rgba(108, 99, 255, 0.1) 100%);
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.2);
}

.platform-btn .platform-icon {
    font-size: 2rem;
}

.platform-btn .platform-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark, #2d3748);
}

.platform-btn.active .platform-name {
    color: var(--accent, #6c63ff);
}

/* ================================
   ADVANCED ANALYTICS
   ================================ */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.analytics-card {
    background: var(--white, #ffffff);
    border-radius: var(--radius-md, 20px);
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.analytics-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark, #2d3748);
}

.trend-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.trend-indicator.positive {
    color: var(--success, #10b981);
}

.trend-indicator.negative {
    color: var(--danger, #ef4444);
}

/* ================================
   RESPONSIVE BREAKPOINTS
   ================================ */

/* Tablet and below */
@media (max-width: 767px) {
    .toast-container {
        top: 80px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        padding: 0.875rem 1rem;
    }
    
    .platform-selector {
        gap: 0.75rem;
    }
    
    .platform-btn {
        padding: 0.75rem 1rem;
        min-width: 100px;
    }
    
    .platform-btn .platform-icon {
        font-size: 1.5rem;
    }
    
    .platform-btn .platform-name {
        font-size: 0.8rem;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .toast-container {
        top: 70px;
        right: 5px;
        left: 5px;
    }
    
    .toast {
        padding: 0.75rem;
    }
    
    .toast-icon {
        width: 24px;
        height: 24px;
        font-size: 1rem;
    }
    
    .toast-title {
        font-size: 0.875rem;
    }
    
    .toast-message {
        font-size: 0.8rem;
    }
}