/* Header Styles */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px) saturate(180%);
    background: var(--header-bg);
    transition: all 0.3s ease;
}

header.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* S.H.I.E.L.D. Logo Styles */

.shield-logo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--primary-blue);
    margin: 0 auto 2rem;
    box-shadow:
        0 0 10px var(--primary-blue),
        0 0 20px var(--primary-blue),
        0 0 30px var(--primary-blue),
        0 0 40px var(--primary-blue);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow:
            0 0 10px var(--primary-blue),
            0 0 20px var(--primary-blue),
            0 0 30px var(--primary-blue),
            0 0 40px var(--primary-blue);
    }
    50% {
        opacity: 0.8;
        box-shadow:
            0 0 20px var(--primary-blue),
            0 0 30px var(--primary-blue),
            0 0 40px var(--primary-blue),
            0 0 60px var(--primary-blue);
    }
}

:root {
    --gradient-lead: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-worker: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-default: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --border-radius: 12px;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --primary-blue: #667eea;
    --shield-red: #dc143c;
}

/* Success Rate Chart Styles */
#success-rate-chart-container {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#success-rate-chart {
    width: 100%;
    height: 400px;
    display: block;
}

/* Spy Activity Table Styles */
#spy-activity-container {
    margin-top: var(--spacing-lg);
}

#spy-activity-container h3 {
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

#spy-activity-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#spy-activity-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#spy-activity-table th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

#spy-activity-table th:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

#spy-activity-table .sort-arrow {
    display: inline-block;
    margin-left: 0.25rem;
    font-size: 0.75rem;
}

#spy-activity-table .sort-arrow.active {
    color: #fff;
    font-weight: bold;
}

#spy-activity-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

#spy-activity-table tbody tr:hover {
    background-color: #f5f5f5;
}

#spy-activity-table tbody tr:last-child {
    border-bottom: none;
}

#spy-activity-table td {
    padding: var(--spacing-md);
    color: var(--text-primary);
}

#spy-activity-table tbody tr td:nth-child(3) {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#spy-activity-table tbody tr td:nth-child(4) {
    text-align: center;
    font-weight: 600;
}

#spy-activity-table tbody tr td:nth-child(5) {
    text-align: right;
    font-family: 'Courier New', monospace;
}

#spy-activity-table tbody tr td:nth-child(6) {
    text-transform: capitalize;
}


/* Pagination Controls Styles */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
}

.pagination-controls button {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.pagination-controls button:hover:not(:disabled) {
    transform: translateY(-2px);
    opacity: 0.9;
}

.pagination-controls button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

#page-info {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 100px;
    text-align: center;
}


/* Cache Status Icon Styles */
.cache-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.875rem;
    cursor: help;
}

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

.cache-icon.cache-miss {
    color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.1);
}

.cache-icon.cache-static {
    color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.1);
}

/* Audit Sessions Table Styles */
#audit-sessions-container {
    margin-top: var(--spacing-lg);
}

#audit-sessions-container h3 {
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

#audit-sessions-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#audit-sessions-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#audit-sessions-table th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
}

#audit-sessions-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

#audit-sessions-table tbody tr:hover {
    background-color: #f5f5f5;
}

#audit-sessions-table tbody tr:last-child {
    border-bottom: none;
}

#audit-sessions-table td {
    padding: var(--spacing-md);
    color: var(--text-primary);
}

#audit-sessions-table tbody tr td:nth-child(3) {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Signal Badges Styles */
.signal-badges {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.signal-badge {
    font-size: 1.2rem;
    display: inline-block;
    cursor: help;
}

.signal-badges.unproductive {
    color: #9ca3af;
    font-weight: 600;
}

/* Mobile Navigation Styles */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.hamburger:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 250px;
        background: rgba(26, 26, 26, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: flex-start;
        padding: 4rem 2rem 2rem;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
        transition: right 0.3s ease-in-out;
        z-index: 1001;
    }

    nav ul.open {
        right: 0;
    }

    nav ul li {
        width: 100%;
        margin: 0.5rem 0;
    }

    nav ul li a {
        display: block;
        padding: 0.75rem 0;
        width: 100%;
    }
}

/* Data Refresh Button Styles */
.data-refresh-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.data-refresh-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.data-refresh-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.data-refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.data-refresh-btn.loading {
    animation: spin 1s linear infinite;
}

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

/* Data Refresh Toast Notification Styles */
.data-refresh-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background-color: #10b981;
    color: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    font-size: 0.95rem;
    font-weight: 600;
    z-index: 2000;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.data-refresh-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.data-refresh-toast.error {
    background-color: #ef4444;
}

@media (max-width: 768px) {
    .data-refresh-btn {
        top: 0.5rem;
        right: 4rem;
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .data-refresh-toast {
        right: 10px;
        left: 10px;
        top: 10px;
        font-size: 0.875rem;
    }
}

/* Hero Section Styles */
.hero-section {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    padding: 4rem 2rem;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--hero-bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.15;
    transition: background-image 1s ease-in-out;
    z-index: 0;
}

.hero-content {
    text-align: center;
    color: white;
    z-index: 1;
    max-width: 1200px;
    padding: 0 1rem;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-section p {
    font-size: 1.5rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .hero-section {
        min-height: 50vh;
        padding: 3rem 1.5rem;
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }

    .hero-section p {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        min-height: 45vh;
        padding: 2rem 1rem;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .hero-section p {
        font-size: 1rem;
    }
}

/* CTA Button Styles */
.cta-button {
    display: inline-block;
    margin-top: 2rem;
    padding: 1rem 2.5rem;
    background: var(--primary-blue);
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.cta-button:active {
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .cta-button {
        font-size: 1.1rem;
        padding: 0.875rem 2rem;
    }
}

@media (max-width: 480px) {
    .cta-button {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
}
