/* =============================================================================
   Mingo - gmail.css
   Gmail deal finder styles
   ============================================================================= */

/* =============================================================================
   GMAIL DEAL FINDER - STYLES (FIXED - NO WARNINGS)
   ============================================================================= */

   .brand-opportunities-section {
    margin-bottom: 2rem;
}

.gmail-connection-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.gmail-connection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.gmail-connection-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.gmail-connection-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.opportunities-list {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

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

.opportunities-header h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.opportunities-count {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.opportunities-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.last-scan-time {
    font-size: 0.875rem;
    color: var(--text-muted);
}

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

.opportunity-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all 0.2s;
}

.opportunity-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.opportunity-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.confidence-high {
    background: #d4edda;
    color: #155724;
}

.confidence-medium {
    background: #fff3cd;
    color: #856404;
}

.confidence-low {
    background: #f8d7da;
    color: #721c24;
}

.opportunity-subject {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    display: -webkit-box;
    display: box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
}

.opportunity-sender {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.opportunity-details {
    background: var(--surface-secondary);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin: 0.75rem 0;
    font-size: 0.875rem;
}

.opportunity-detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.opportunity-detail-item:last-child {
    margin-bottom: 0;
}

.opportunity-detail-label {
    color: var(--text-muted);
}

.opportunity-detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

.opportunity-snippet {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0.75rem 0;
    display: -webkit-box;
    display: box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
}

.opportunity-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.opportunity-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.opportunity-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

@media (max-width: 768px) {
    .gmail-connection-header,
    .opportunities-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .opportunities-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .opportunities-grid {
        grid-template-columns: 1fr;
    }
}

/* Archived Deals Section */
.archived-deal-card {
    background: var(--surface-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.archived-deal-card:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.deal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.deal-card-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
}

.deal-amount {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--success-color);
    white-space: nowrap;
}

.deal-card-body {
    margin-bottom: 1rem;
}

.deal-deliverables {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.deal-due-date {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
}

.deal-card-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.deal-card-actions button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.deal-card-actions svg {
    flex-shrink: 0;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-large {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

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

/* Loading overlay for tabs */
.tab-loading {
    position: relative;
    opacity: 0.5;
    pointer-events: none;
}

.tab-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 1000;
}

/* Make Upload button prominent (center button) */
.tab-primary {
    background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
    color: white !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.tab-primary:hover {
    background: linear-gradient(135deg, #0066DD 0%, #0046BB 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.tab-primary.active {
    background: linear-gradient(135deg, #0051D5 0%, #003A99 100%);
}

.tab-primary svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Mobile primary button */
.mobile-tab-primary {
    background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
    color: white !important;
    border-radius: 16px;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.mobile-tab-primary .mobile-tab-icon {
    stroke: white;
}

.mobile-tab-primary .mobile-tab-label {
    color: white;
    font-weight: 600;
}

.mobile-tab-primary.active {
    background: linear-gradient(135deg, #0051D5 0%, #003A99 100%);
}

/* Pipeline Layout with Sidebar */
.pipeline-layout {
    display: flex;
    gap: 0;
    height: calc(100vh - 200px);
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pipeline-main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.pipeline-section {
    display: none;
    width: 100%;
}

.pipeline-section.active {
    display: block;
}

/* Mobile: Stack sidebar on top */
@media (max-width: 768px) {
    .pipeline-layout {
        flex-direction: column;
    }
}