/* Custom CSS for Competitor Signals */

/* Print Styles for Reports */
@media print {
    /* Hide navigation and UI elements */
    .no-print,
    .navbar,
    .sidebar,
    .btn,
    .dropdown,
    .tooltip,
    .toast {
        display: none !important;
    }
    
    /* Reset page styles */
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
        line-height: 1.4;
        margin: 0;
        padding: 0;
    }
    
    /* Page breaks */
    .page-break {
        page-break-before: always;
    }
    
    .avoid-break {
        page-break-inside: avoid;
    }
    
    /* Report content */
    .report-content {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Cards and containers */
    .card {
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 0 !important;
        margin-bottom: 1rem;
    }
    
    /* Typography */
    h1, h2, h3, h4, h5, h6 {
        color: black !important;
        page-break-after: avoid;
    }
    
    /* Tables */
    table {
        border-collapse: collapse;
        width: 100%;
    }
    
    th, td {
        border: 1px solid #ccc;
        padding: 8px;
        text-align: left;
    }
    
    th {
        background-color: #f5f5f5 !important;
        font-weight: bold;
    }
    
    /* Links */
    a {
        color: #1e40af !important;
        text-decoration: underline;
    }
    
    /* Charts and images */
    svg, img {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* Custom Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

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

.animate-slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

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

.animate-count-up {
    animation: countUp 1s ease-out;
}

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

/* Enhanced Focus Styles */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
    border-color: #3b82f6;
}

/* Loading States */
.loading-overlay {
    position: relative;
}

.loading-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Kind and Source Pills */
.kind-pill {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.kind-offer {
    background-color: #dcfce7;
    color: #166534;
}

.kind-service {
    background-color: #dbeafe;
    color: #1e40af;
}

.kind-review {
    background-color: #f3e8ff;
    color: #7c3aed;
}

.kind-photo {
    background-color: #fce7f3;
    color: #be185d;
}

.kind-site_update {
    background-color: #fed7aa;
    color: #c2410c;
}

.source-pill {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    text-transform: capitalize;
}

.source-site {
    background-color: #f1f5f9;
    color: #475569;
}

.source-gbp {
    background-color: #fee2e2;
    color: #dc2626;
}

.source-social {
    background-color: #e0e7ff;
    color: #4338ca;
}

/* Dark mode support for pills */
[data-theme="dark"] .kind-offer {
    background-color: #14532d;
    color: #86efac;
}

[data-theme="dark"] .kind-service {
    background-color: #1e3a8a;
    color: #93c5fd;
}

[data-theme="dark"] .kind-review {
    background-color: #581c87;
    color: #c4b5fd;
}

[data-theme="dark"] .kind-photo {
    background-color: #831843;
    color: #f9a8d4;
}

[data-theme="dark"] .kind-site_update {
    background-color: #9a3412;
    color: #fdba74;
}

/* Enhanced Table Styles */
.table-enhanced {
    border-collapse: separate;
    border-spacing: 0;
}

.table-enhanced th {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-enhanced tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.table-enhanced td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

/* Avatar Styles */
.avatar-competitor {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Card Enhancements */
.card-hover {
    transition: all 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Button Enhancements */
.btn-gradient {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    border: none;
    color: white;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-gradient:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Modal Enhancements */
.modal-box-enhanced {
    background: white;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Form Enhancements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Toast Enhancements */
.toast-enhanced {
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Sparkline Chart */
.sparkline {
    width: 100%;
    height: 60px;
}

.sparkline-path {
    fill: none;
    stroke: #3b82f6;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sparkline-area {
    fill: url(#sparklineGradient);
    opacity: 0.3;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .mobile-stack {
        flex-direction: column;
    }
    
    .mobile-stack > * {
        margin-bottom: 0.5rem;
    }
    
    .mobile-hide {
        display: none;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Accessibility Enhancements */
.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;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .kind-pill,
    .source-pill {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Loading spinner custom */
.spinner-custom {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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