/**
 * GSC Panel - Common Styles
 * Shared styles across all pages
 */

/* ==================== DESIGN TOKENS (CSS Variables) ==================== */
:root {
  /* Primary Colors */
  --color-primary: #3498db;
  --color-primary-hover: #2980b9;
  --color-primary-dark: #2c3e50;

  /* Status Colors */
  --color-success: #27ae60;
  --color-success-hover: #229954;
  --color-success-bg: #d4edda;
  --color-success-border: #c3e6cb;
  --color-success-text: #155724;

  --color-warning: #f39c12;
  --color-warning-hover: #e67e22;
  --color-warning-bg: #fff3cd;
  --color-warning-border: #ffeeba;
  --color-warning-text: #856404;

  --color-danger: #e74c3c;
  --color-danger-hover: #c0392b;
  --color-danger-bg: #f8d7da;
  --color-danger-border: #f5c6cb;
  --color-danger-text: #721c24;

  --color-info: #3498db;
  --color-info-bg: #d1ecf1;
  --color-info-border: #bee5eb;
  --color-info-text: #0c5460;

  /* Neutral Colors */
  --color-gray-50: #f8f9fa;
  --color-gray-100: #f5f7fa;
  --color-gray-200: #ecf0f1;
  --color-gray-300: #e9ecef;
  --color-gray-400: #dee2e6;
  --color-gray-500: #bdc3c7;
  --color-gray-600: #5a6a6e;
  --color-gray-700: #555;
  --color-gray-800: #333;

  /* Text Colors */
  --color-text: #333;
  --color-text-secondary: #5a6a6e;
  --color-text-muted: #717171;
  --color-text-heading: #2c3e50;

  /* Border Colors */
  --color-border: #ddd;
  --color-border-light: #eee;

  /* Background Colors */
  --color-bg-page: #f5f7fa;
  --color-bg-card: white;
  --color-primary-bg: #ebf5fb;
  --bg-dark: #1a1a2e;
  --bg-hover: rgba(0, 0, 0, 0.04);
  --text-light: #e0e0e0;
  --primary: var(--color-primary);

  /* Brand Colors */
  --color-google: #4285f4;
  --color-google-hover: #3367d6;
  --color-bing: #00809d;
  --color-bing-hover: #006680;
  --color-seznam: #cc0000;
  --color-seznam-hover: #a30000;

  /* Spacing Scale (base: 4px) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-family-mono: monospace;

  --font-size-xs: 10px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --font-size-3xl: 28px;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.2;
  --line-height-base: 1.6;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-modal: 0 4px 20px rgba(0,0,0,0.3);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;

  /* Z-Index Scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 500;
  --z-modal-backdrop: 900;
  --z-modal: 1000;
  --z-tooltip: 1100;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: white;
    padding: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 28px;
    color: #2c3e50;
    display: flex;
    align-items: center;
}

header h1 a {
    text-decoration: none;
    color: #2c3e50;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

header h1 span {
    font-weight: 300;
    color: #7f8c8d;
    font-size: 20px;
    margin-left: 8px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: #7f8c8d;
    font-size: 14px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.btn .icon {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
}

.btn-secondary:hover {
    background: #bdc3c7;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-outline-danger {
    background: transparent;
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
}

.btn-outline-danger:hover {
    background: var(--color-danger);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: var(--font-size-sm);
    min-height: 44px;
    min-width: 44px;
}

/* Inline loading spinner */
@keyframes inline-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.inline-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--color-border, #ddd);
    border-top-color: var(--color-primary, #3498db);
    border-radius: 50%;
    animation: inline-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
    border: 1px solid var(--color-warning-border);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.empty-state .icon {
    width: 64px;
    height: 64px;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.empty-state p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

/* Card */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 25px;
}

.card h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 20px;
}

.card p {
    color: #7f8c8d;
    margin-bottom: 15px;
}

/* Form Elements */
label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

select, input[type="date"], input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
}

/* Keyboard focus indicator for all interactive elements */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: none; /* these use border-color + box-shadow instead */
}

/* Skip link — hidden until focused */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 10000;
    padding: 8px 16px;
    background: var(--color-primary-dark);
    color: #fff;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    text-decoration: none;
}

.skip-link:focus {
    top: 8px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
}

table tr:hover {
    background: #f8f9fa;
}

.number {
    font-weight: 600;
    color: #2c3e50;
}

/* VirusTotal Badge */
.vt-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
    margin-left: 5px;
    cursor: help;
}

.vt-badge .icon {
    width: 12px;
    height: 12px;
}

.vt-badge.clean {
    background: #d4edda;
    color: #155724;
}

.vt-badge.suspicious {
    background: #fff3cd;
    color: #856404;
}

.vt-badge.malicious {
    background: #f8d7da;
    color: #721c24;
    animation: pulse 2s infinite;
}

.vt-badge.unknown {
    background: #e9ecef;
    color: #6c757d;
}

/* UptimeRobot Badge */
.uptime-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
    margin-left: 5px;
    cursor: help;
}

.uptime-badge .icon {
    width: 12px;
    height: 12px;
}

.uptime-badge.up {
    background: #d4edda;
    color: #155724;
}

.uptime-badge.down {
    background: #f8d7da;
    color: #721c24;
    animation: pulse 2s infinite;
}

.uptime-badge.paused {
    background: #fff3cd;
    color: #856404;
}

.uptime-badge.unknown {
    background: #e9ecef;
    color: #6c757d;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* DMCA Badge */
.dmca-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
    margin-left: 5px;
    cursor: help;
}

.dmca-badge .icon {
    width: 12px;
    height: 12px;
}

.dmca-badge.clean {
    background: #d4edda;
    color: #155724;
}

.dmca-badge.few {
    background: #fff3cd;
    color: #856404;
}

.dmca-badge.many {
    background: #f8d7da;
    color: #721c24;
}

.dmca-badge.unknown {
    background: #e9ecef;
    color: #6c757d;
}

/* Bing Crawl Badge */
.bing-crawl-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
    margin-left: 5px;
    cursor: help;
}

.bing-crawl-badge .icon {
    width: 12px;
    height: 12px;
}

.bing-crawl-badge.healthy {
    background: #d4edda;
    color: #155724;
}

.bing-crawl-badge.warning {
    background: #fff3cd;
    color: #856404;
}

.bing-crawl-badge.critical {
    background: #f8d7da;
    color: #721c24;
    animation: pulse-critical 2s infinite;
}

.bing-crawl-badge.unknown {
    background: #e9ecef;
    color: #6c757d;
}

.bing-crawl-badge small {
    font-size: 9px;
    opacity: 0.85;
}

.bing-crawl-badge small.positive {
    color: #155724;
}

.bing-crawl-badge small.negative {
    color: #721c24;
}

@keyframes pulse-critical {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Notification Bell */
.notification-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #ecf0f1;
    text-decoration: none;
    transition: all 0.2s;
}

.notification-bell:hover {
    background: #bdc3c7;
}

.notification-bell .icon {
    width: 18px;
    height: 18px;
    color: #2c3e50;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid white;
}

.notification-bell.has-notifications {
    animation: bell-pulse 2s infinite;
}

@keyframes bell-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Mail Bell (Gmail) */
.mail-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #ecf0f1;
    text-decoration: none;
    transition: all 0.2s;
}

.mail-bell:hover {
    background: #bdc3c7;
}

.mail-bell .icon {
    width: 18px;
    height: 18px;
    color: #2c3e50;
}

.mail-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #3498db;
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid white;
}

.mail-bell.has-emails {
    animation: mail-pulse 2s infinite;
}

@keyframes mail-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* CrUX (Core Web Vitals) Badges */
.crux-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 8px;
    font-weight: 600;
    cursor: help;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.crux-badge.crux-good {
    background: #d4edda;
    color: #155724;
}

.crux-badge.crux-ni {
    background: #fff3cd;
    color: #856404;
}

.crux-badge.crux-poor {
    background: #f8d7da;
    color: #721c24;
    animation: pulse 2s infinite;
}

.crux-badge.crux-unknown {
    background: #e9ecef;
    color: #6c757d;
}

/* SSL Certificate Badges */
.ssl-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
    margin-left: 5px;
    cursor: help;
}

.ssl-badge .icon {
    width: 12px;
    height: 12px;
}

.ssl-badge.valid {
    background: #d4edda;
    color: #155724;
}

.ssl-badge.expiring {
    background: #fff3cd;
    color: #856404;
    animation: pulse 2s infinite;
}

.ssl-badge.expired {
    background: #f8d7da;
    color: #721c24;
    animation: pulse 2s infinite;
}

.ssl-badge.invalid {
    background: #f8d7da;
    color: #721c24;
}

.ssl-badge.no-ssl {
    background: #fff3cd;
    color: #856404;
}

.ssl-badge.error {
    background: #e9ecef;
    color: #6c757d;
}

.ssl-badge.unknown {
    background: #e9ecef;
    color: #6c757d;
}

/* Privacy Toggle Button */
.privacy-toggle {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #7f8c8d;
}

.privacy-toggle:hover {
    background: #f5f5f5;
    color: #2c3e50;
}

.privacy-toggle.active {
    background: #27ae60;
    border-color: #27ae60;
    color: white;
}

.privacy-toggle .icon {
    width: 16px;
    height: 16px;
}

/* Privacy Mode - Hide sensitive data */
body.privacy-mode .privacy-blur {
    filter: blur(5px);
    user-select: none;
    transition: filter 0.2s;
}

body.privacy-mode .privacy-blur:hover {
    filter: blur(3px);
}

/* Specific elements to blur on index.php */
body.privacy-mode .site-name,
body.privacy-mode .site-url,
body.privacy-mode .site-tags .tag {
    filter: blur(5px);
    user-select: none;
}

/* Specific elements to blur on dashboard.php */
body.privacy-mode .site-info h2,
body.privacy-mode .site-info p,
body.privacy-mode .breadcrumb span:last-child,
body.privacy-mode .table-card table tbody td:first-child {
    filter: blur(5px);
    user-select: none;
}

/* Specific elements to blur on gmail.php */
body.privacy-mode .email-from,
body.privacy-mode .email-subject,
body.privacy-mode .email-snippet,
body.privacy-mode .account-chip span,
body.privacy-mode .email-account {
    filter: blur(5px);
    user-select: none;
}

/* Specific elements to blur on notifications.php */
body.privacy-mode .notification-title,
body.privacy-mode .notification-message,
body.privacy-mode .notification-meta a {
    filter: blur(5px);
    user-select: none;
}

/* General sensitive elements */
body.privacy-mode .account-name,
body.privacy-mode .account-email,
body.privacy-mode .email-display,
body.privacy-mode .account-info h4,
body.privacy-mode .tag-filter-btn:not(.tag-all) {
    filter: blur(5px);
    user-select: none;
}

/* Privacy: Tasks */
body.privacy-mode .task-title-text,
body.privacy-mode .today-task-title,
body.privacy-mode .today-task-project,
body.privacy-mode .task-project-tag,
body.privacy-mode .task-site-tag {
    filter: blur(5px);
    user-select: none;
}

/* Privacy: Projects */
body.privacy-mode .project-card-name,
body.privacy-mode .project-header-name {
    filter: blur(5px);
    user-select: none;
}

/* Privacy: Server logs */
body.privacy-mode .url-cell,
body.privacy-mode .message-cell,
body.privacy-mode .ip-cell,
body.privacy-mode .domain-badge {
    filter: blur(5px);
    user-select: none;
}

/* Privacy: Analytics tables */
body.privacy-mode .data-table tbody td:first-child {
    filter: blur(5px);
    user-select: none;
}

/* Privacy: Project details */
body.privacy-mode .sites-table .domain-cell,
body.privacy-mode .note-content {
    filter: blur(5px);
    user-select: none;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .user-info {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ==================== ENHANCED MOBILE STYLES ==================== */

@media (max-width: 768px) {
    /* Header improvements */
    header .header-content {
        flex-direction: column;
        gap: 12px;
        padding: 12px 0;
    }

    header h1 {
        font-size: 16px;
        text-align: center;
    }

    header h1 span {
        display: block;
        margin-top: 4px;
        font-size: 14px;
    }

    .user-info {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .user-info .btn {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 40px;
    }

    .user-name {
        width: 100%;
        text-align: center;
        order: -1;
        font-size: 13px;
    }

    /* Controls bar */
    .controls-bar {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }

    .control-group {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .control-group select {
        flex: 1;
        min-width: 120px;
    }

    /* Site cards */
    .sites-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .site-card {
        border-radius: 8px;
    }

    .site-header {
        padding: 12px;
    }

    .site-name {
        font-size: 15px;
    }

    .site-url {
        font-size: 11px;
    }

    .site-stats {
        grid-template-columns: repeat(2, 1fr);
        padding: 10px 12px;
        gap: 8px;
    }

    .stat-value {
        font-size: 14px;
    }

    .stat-label {
        font-size: 10px;
    }

    .chart-container {
        height: 140px;
        padding: 8px 12px;
    }

    .site-checks {
        gap: 5px;
    }

    .site-check-icon {
        width: 24px;
        height: 24px;
    }

    /* Tags filter */
    .tags-filter {
        padding: 12px;
    }

    .tags-list {
        gap: 8px;
    }

    .tag-filter-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    /* Issues filter */
    .issues-filter {
        padding: 10px 12px;
    }

    .issues-list {
        gap: 8px;
    }

    .issue-filter-btn {
        padding: 4px 8px;
        font-size: 10px;
    }

    .issues-label {
        width: 100%;
        margin-bottom: 8px;
    }

    /* Forms */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevent iOS zoom */
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions .btn {
        width: 100%;
    }

    /* Modals */
    .modal-content {
        margin: 10px;
        padding: 16px;
        max-width: none;
    }

    .modal-header h3 {
        font-size: 16px;
    }

    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive table {
        min-width: 500px;
    }

    table th,
    table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    /* Touch targets - minimum 44px */
    .btn,
    button,
    a.btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn-sm {
        min-height: 44px;
    }

    /* Dashboard overview cards */
    .dashboard-overview {
        grid-template-columns: 1fr;
    }

    .overview-card {
        padding: 15px;
    }

    /* Stats row */
    .stats-row {
        flex-direction: column;
        gap: 10px;
    }

    .stat-card {
        width: 100%;
    }

    /* Container padding */
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Small phones (under 480px) */
@media (max-width: 480px) {
    .privacy-toggle {
        display: none;
    }

    .tag {
        padding: 2px 6px;
        font-size: 9px;
    }

    header h1 {
        font-size: 14px;
    }

    .site-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .site-tags {
        flex-wrap: wrap;
    }

    /* Hide button text, show only icons */
    .user-info .btn span {
        display: none;
    }

    .user-info .btn .icon {
        margin: 0;
    }
}

/* Tablets (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .sites-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .controls-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .threshold-inputs {
        grid-template-columns: repeat(3, 1fr);
    }

    .checks-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Landscape phones */
@media (max-width: 768px) and (orientation: landscape) {
    .sites-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    header .header-content {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* ==================== MOBILE CARD VIEW FOR TABLES ==================== */
@media (max-width: 768px) {
    /* Hide table headers on mobile */
    .table-card-mobile thead {
        display: none;
    }

    .table-card-mobile tbody tr {
        display: block;
        margin-bottom: 15px;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        padding: 15px;
    }

    .table-card-mobile tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #eee;
        text-align: right;
    }

    .table-card-mobile tbody td:last-child {
        border-bottom: none;
    }

    .table-card-mobile tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #555;
        text-align: left;
        flex-shrink: 0;
        margin-right: 10px;
    }

    .table-card-mobile tbody td.no-label::before {
        display: none;
    }

    /* Card header style for first cell */
    .table-card-mobile tbody td:first-child {
        font-weight: 600;
        font-size: 14px;
        border-bottom: 2px solid #3498db;
        margin-bottom: 5px;
        padding-bottom: 10px;
    }

    /* Action buttons in cards */
    .table-card-mobile .btn-sm {
        padding: 6px 10px;
    }

    /* Status badges in cards */
    .table-card-mobile .badge {
        font-size: 11px;
    }
}

/* ==================== MOBILE BOTTOM TAB BAR ==================== */
.mobile-tab-bar {
    display: none; /* Hidden on desktop */
}

@media (max-width: 768px) {
    .mobile-tab-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid #e0e0e0;
        padding: 8px 0;
        padding-bottom: calc(8px + env(safe-area-inset-bottom)); /* iPhone notch */
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }

    .tab-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #8e8e93;
        font-size: 10px;
        gap: 4px;
        position: relative;
        padding: 4px 0;
        transition: color 0.2s;
    }

    .tab-item .icon {
        width: 24px;
        height: 24px;
    }

    .tab-item.active {
        color: #3498db;
    }

    .tab-item .tab-badge {
        position: absolute;
        top: 0;
        right: 50%;
        transform: translateX(12px);
        background: #e74c3c;
        color: white;
        font-size: 10px;
        font-weight: 600;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
    }

    /* Add padding to body so content doesn't hide behind tab bar */
    body {
        padding-bottom: 70px;
    }

    /* Hide entire user-info on mobile - navigation is in tab bar */
    .user-info {
        display: none !important;
    }

    /* Mobile header - show only page title */
    .desktop-header {
        display: none !important;
    }

    .mobile-header {
        display: block !important;
        font-size: 18px;
        font-weight: 600;
        color: #2c3e50;
        margin: 0;
    }

    /* Simplify header on mobile */
    header .header-content {
        justify-content: center;
        padding: 12px 0;
    }
}

/* Desktop styles */
.mobile-header {
    display: none;
}

/* ==================== UNIFIED COMPONENTS ==================== */

/* --- Controls Component (for pages.php, queries.php, etc.) --- */
.controls {
    background: var(--color-bg-card);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-6);
}

.controls-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto auto;
    gap: var(--space-4);
    align-items: end;
}

.control-group {
    display: flex;
    flex-direction: column;
}

/* --- Stats Bar Component --- */
.stats-bar {
    background: var(--color-bg-card);
    padding: 15px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-bar h2 {
    font-size: var(--font-size-xl);
    color: var(--color-text-heading);
    margin: 0;
}

.stats-bar .total {
    font-size: var(--font-size-md);
    color: var(--color-text-secondary);
}

/* --- Table Card Component --- */
.table-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-card table th {
    background: var(--color-gray-50);
    padding: 15px;
    text-align: left;
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-700);
    border-bottom: 2px solid var(--color-gray-400);
    font-size: var(--font-size-base);
    position: sticky;
    top: 0;
}

.table-card table td {
    padding: 15px;
    border-bottom: 1px solid var(--color-gray-400);
    font-size: var(--font-size-base);
}

/* --- Account List Component (for google-accounts.php, bing-accounts.php) --- */
.accounts-list {
    margin-top: var(--space-5);
}

.account-item {
    background: var(--color-gray-50);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.account-info h3 {
    color: var(--color-text-heading);
    margin-bottom: var(--space-1);
    font-size: var(--font-size-lg);
}

.account-meta {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.account-actions {
    display: flex;
    gap: var(--space-2);
}

/* Status badges for accounts */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
}

.status-valid {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

.status-invalid {
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
}

.status-expiring {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

/* Sites count badge */
.sites-badge {
    display: inline-block;
    background: var(--color-primary);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    margin-left: var(--space-2);
}

/* Code/Key displays */
.key-display,
.email-display,
.api-key-display {
    font-family: var(--font-family-mono);
    background: var(--color-gray-200);
    padding: 2px 8px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
}

/* --- Modal Component --- */
.modal {
    display: none;
    position: fixed;
    z-index: var(--z-modal);
    inset: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: var(--color-bg-card);
    margin: 10% auto;
    padding: 30px;
    border-radius: var(--radius-xl);
    max-width: 500px;
    box-shadow: var(--shadow-modal);
}

.modal-header h3 {
    margin-bottom: var(--space-5);
    color: var(--color-text-heading);
}

.modal-actions {
    display: flex;
    gap: var(--space-2);
    justify-content: flex-end;
    margin-top: var(--space-5);
}

/* --- Tag Selector Component (for add-site.php, edit-site.php) --- */
.tags-selector {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.tag-checkbox {
    display: none;
}

.tag-label {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    cursor: pointer;
    border: 2px solid transparent;
    color: white;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: var(--transition-base);
}

.form-group .tags-selector label {
    color: white;
}

.tag-checkbox:checked + .tag-label {
    border-color: var(--color-primary-dark);
    box-shadow: var(--shadow-md);
}

.new-tag-form {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-gray-200);
}

.new-tag-form input[type="text"] {
    flex: 1;
}

.new-tag-form input[type="color"] {
    width: 60px;
    height: 44px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
}

/* --- Form Actions Component --- */
.form-actions {
    display: flex;
    gap: var(--space-2);
    justify-content: flex-end;
    margin-top: var(--space-6);
}

/* --- Brand Buttons --- */
.btn-google {
    background: var(--color-google);
    color: white;
}

.btn-google:hover {
    background: var(--color-google-hover);
}

.btn-bing {
    background: var(--color-bing);
    color: white;
}

.btn-bing:hover {
    background: var(--color-bing-hover);
}

.btn-seznam {
    background: var(--color-seznam);
    color: white;
}

.btn-seznam:hover {
    background: var(--color-seznam-hover);
}

/* --- Pagination Component --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-5);
    padding: var(--space-5);
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.pagination a,
.pagination span {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--color-primary);
    font-weight: var(--font-weight-medium);
}

.pagination a:hover {
    background: var(--color-primary);
    color: white;
}

.pagination .current {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.pagination .disabled {
    color: var(--color-gray-500);
    pointer-events: none;
}

/* --- Query/Page Text --- */
.query-text,
.page_url {
    max-width: 500px;
    word-break: break-word;
}

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

/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.d-inline-flex { display: inline-flex !important; }

/* Flexbox */
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* Gap */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }

/* Margin */
.m-0 { margin: 0 !important; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.ml-auto { margin-left: auto; }

/* Padding */
.p-0 { padding: 0 !important; }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }

/* Text */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }
.max-w-sm { max-width: 400px; }
.max-w-md { max-width: 600px; }
.max-w-lg { max-width: 800px; }
.max-w-xl { max-width: 1000px; }

/* Border Radius */
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-none { box-shadow: none; }

/* ==================== RESPONSIVE COMPONENT OVERRIDES ==================== */
@media (max-width: 768px) {
    .controls-grid {
        grid-template-columns: 1fr;
    }

    .controls-grid button {
        margin-top: 0;
    }

    .stats-bar {
        flex-direction: column;
        gap: var(--space-2);
        text-align: center;
    }

    .account-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }

    .account-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .modal-content {
        margin: var(--space-2);
        padding: var(--space-4);
        max-width: none;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* ==================== VISUAL REDESIGN COMPONENTS ==================== */

/* --- Page Card (unified card component for all pages) --- */
.page-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 25px;
    transition: box-shadow 0.3s ease;
}

.page-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Breadcrumbs */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-3);
}

.breadcrumb a {
    color: var(--color-primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    color: var(--color-text-muted);
}

.page-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ecf0f1;
}

.page-card-header h2 {
    font-size: 20px;
    color: #2c3e50;
    font-weight: 600;
    margin: 0;
}

.page-card-header .badge {
    background: #3498db;
    color: white;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

/* --- Stats Card (gradient hero blocks) --- */
.stats-card-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.stats-card-gradient.blue {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.stats-card-gradient.green {
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
}

.stats-card-gradient.orange {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.stats-card-gradient .stat-item {
    text-align: center;
    min-width: 100px;
}

.stats-card-gradient h3 {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 500;
}

.stats-card-gradient .value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
}

.stats-card-gradient .label {
    opacity: 0.8;
    font-size: 13px;
    margin-top: 4px;
}

/* --- List Item (universal, like in gmail/notifications) --- */
.list-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background-color: #f9f9f9;
}

.list-item.unread {
    background-color: #f0f7ff;
}

.list-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.list-item-icon .icon {
    width: 20px;
    height: 20px;
}

/* Neutral icon backgrounds - avoid traffic light effect */
.list-item-icon.success,
.list-item-icon.warning,
.list-item-icon.danger,
.list-item-icon.info { background: #f5f7fa; color: #7f8c8d; }
.list-item-icon.neutral { background: #ecf0f1; color: #7f8c8d; }

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.list-item-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.list-item-meta {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 8px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.list-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* --- Filter Pills (like tag-filter in index.php) --- */
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.filter-pill {
    padding: 8px 16px;
    border-radius: 8px;
    border: 2px solid #ecf0f1;
    background: white;
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.filter-pill:hover {
    border-color: #bdc3c7;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    color: #2c3e50;
}

.filter-pill.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

/* --- Enhanced Data Table --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    background: #f8f9fa;
    padding: 14px 15px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #ecf0f1;
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: #f9f9f9;
}

.data-table tbody td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: #333;
    vertical-align: middle;
}

.data-table .number {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #2c3e50;
}

/* Position badges for tables (neutral, non-colorful design) */
.position-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 26px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: #f5f7fa;
    color: #2c3e50;
    border: 1px solid #ecf0f1;
}

/* All position badges now have the same neutral style */
.position-badge.top-3,
.position-badge.top-10,
.position-badge.top-20,
.position-badge.low {
    background: #f5f7fa;
    color: #2c3e50;
    border: 1px solid #ecf0f1;
}

/* Change indicator */
.change-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
}

.change-indicator.positive { color: #27ae60; }
.change-indicator.negative { color: #e74c3c; }
.change-indicator.neutral { color: #7f8c8d; }

/* --- Enhanced Account Card --- */
.account-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.account-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.account-card-main {
    display: flex;
    align-items: center;
    gap: 15px;
}

.account-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

/* Solid pastel backgrounds for account avatars - no gradients */
.account-card-avatar.google { background: #e8f0fe; color: #4285f4; }
.account-card-avatar.bing { background: #e5f3f5; color: #00809d; }
.account-card-avatar.seznam { background: #fce8e8; color: #cc0000; }

.account-card-avatar .icon {
    width: 24px;
    height: 24px;
}

.account-card-info h3 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 4px;
    font-weight: 600;
}

.account-card-info h3 .sites-badge {
    margin-left: 8px;
}

.account-card-meta {
    font-size: 13px;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.account-card-actions {
    display: flex;
    gap: 8px;
}

/* --- Enhanced Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

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

.modal-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 500px;
    width: 90%;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

.modal-box-header {
    padding: 20px 25px;
    border-bottom: 1px solid #ecf0f1;
}

.modal-box-header h3 {
    font-size: 18px;
    color: #2c3e50;
    margin: 0;
    font-weight: 600;
}

.modal-box-body {
    padding: 25px;
}

.modal-box-footer {
    padding: 15px 25px;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* --- Timeline Events (for site-events.php) --- */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ecf0f1;
}

.timeline-item {
    position: relative;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    margin-left: 20px;
    transition: all 0.2s ease;
}

.timeline-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #3498db;
    background: #3498db;
}

/* Neutral timeline dots - avoid traffic light effect */
.timeline-item.success::before,
.timeline-item.warning::before,
.timeline-item.danger::before,
.timeline-item.info::before { background: #95a5a6; box-shadow: 0 0 0 2px #95a5a6; }

.timeline-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.timeline-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
}

.timeline-item-date {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
}

.timeline-item-type {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 10px;
    background: #ecf0f1;
    color: #7f8c8d;
}

/* Neutral type badges - avoid traffic light effect */
.timeline-item-type.success,
.timeline-item-type.warning,
.timeline-item-type.info,
.timeline-item-type.danger { background: #ecf0f1; color: #7f8c8d; }

.timeline-item-content {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* --- Help Text for forms --- */
.help-text {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
}

/* --- Form Group Enhanced --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

.form-group label .required {
    color: #e74c3c;
    margin-left: 2px;
}

/* --- Integration Status Boxes (for edit-site.php) --- */
.integration-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    border: 2px solid #ecf0f1;
    transition: all 0.2s ease;
}

.integration-box:hover {
    border-color: #bdc3c7;
}

.integration-box.connected {
    border-color: #27ae60;
    background: #f0fff4;
}

.integration-box.warning {
    border-color: #f39c12;
    background: #fffdf0;
}

.integration-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.integration-box-header h4 {
    font-size: 16px;
    color: #2c3e50;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.integration-box-content {
    font-size: 14px;
    color: #555;
}

/* --- Info Cards Grid --- */
.info-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.info-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.info-card-value {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.info-card-label {
    font-size: 13px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-card.primary { border-top: 3px solid #3498db; }
.info-card.success { border-top: 3px solid #27ae60; }
.info-card.warning { border-top: 3px solid #f39c12; }
.info-card.danger { border-top: 3px solid #e74c3c; }

/* --- Tags Filter with Controls --- */
.tags-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.tags-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tags-control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    border-radius: 8px;
    background: white;
    border: 1px solid #ecf0f1;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    box-sizing: border-box;
    padding: 0;
    line-height: 1;
}

.tags-control-btn:hover {
    background: #f8f9fa;
    color: #3498db;
    border-color: #3498db;
}

.tags-control-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.compact-select {
    height: 36px;
    padding: 0 28px 0 10px;
    border-radius: 8px;
    border: 1px solid #ecf0f1;
    background: white;
    font-size: 13px;
    cursor: pointer;
    color: #7f8c8d;
    outline: none;
    transition: all 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237f8c8d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.compact-select:hover,
.compact-select:focus {
    border-color: #3498db;
    color: #3498db;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233498db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* --- Account Select (Gmail page) --- */
.account-select {
    height: 40px;
    padding: 0 32px 0 12px;
    border-radius: 8px;
    border: 1px solid #ecf0f1;
    background: white;
    font-size: 14px;
    cursor: pointer;
    color: #2c3e50;
    outline: none;
    transition: all 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237f8c8d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 200px;
    max-width: 100%;
}

.account-select:hover,
.account-select:focus {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233498db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

@media (max-width: 768px) {
    .account-select {
        width: 100%;
        min-width: unset;
    }
}

/* --- Issues Select (Index page) --- */
.issues-select {
    height: 36px;
    padding: 0 28px 0 10px;
    border-radius: 8px;
    border: 1px solid #fed7d7;
    background: #fff5f5;
    font-size: 13px;
    cursor: pointer;
    color: #c53030;
    font-weight: 500;
    outline: none;
    transition: all 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c53030' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.issues-select:hover,
.issues-select:focus {
    border-color: #fc8181;
    background-color: #fed7d7;
    box-shadow: 0 2px 8px rgba(197, 48, 48, 0.15);
}

.issues-select.has-issues {
    background-color: #fed7d7;
    border-color: #fc8181;
}

/* --- Google Update Tooltip --- */
.google-update-tooltip {
    position: fixed;
    background: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    max-width: 250px;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* --- Site Search Bar --- */
.search-bar {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 15px;
    border: 2px solid transparent;
    transition: border-color 0.2s, background-color 0.2s;
}

.search-input-wrapper:focus-within {
    border-color: #3498db;
    background: white;
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    color: #2c3e50;
}

.search-input-wrapper input::placeholder {
    color: #95a5a6;
}

.search-input-wrapper .icon {
    color: #7f8c8d;
}

.search-clear {
    background: none;
    border: none;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.search-clear:hover {
    color: #e74c3c;
}

.site-card.hidden {
    display: none !important;
}

.no-search-results {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.no-search-results .empty-state h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

/* --- Sortable Table Headers --- */
.sortable-header {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: color 0.2s;
    white-space: nowrap;
}

.sortable-header:hover {
    color: #3498db;
}

.data-table th .sortable-header {
    font-weight: 600;
}

/* --- Mobile Header Buttons --- */
.mobile-refresh-btn,
.mobile-back-btn {
    display: none;
}

/* --- Responsive Visibility Classes --- */
.mobile-only {
    display: none !important;
}

/* --- Responsive for new components --- */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    select.mobile-only {
        display: block !important;
    }
    /* Mobile back button */
    .mobile-back-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        background: transparent;
        border: none;
        color: #3498db;
        padding: 8px;
        cursor: pointer;
        border-radius: 50%;
        transition: background-color 0.2s;
        z-index: 10;
    }

    .mobile-back-btn:hover,
    .mobile-back-btn:active {
        background: rgba(52, 152, 219, 0.1);
    }

    /* Mobile refresh button */
    .mobile-refresh-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        background: transparent;
        border: none;
        color: #3498db;
        padding: 8px;
        cursor: pointer;
        border-radius: 50%;
        transition: background-color 0.2s;
        z-index: 10;
    }

    .mobile-refresh-btn:hover,
    .mobile-refresh-btn:active {
        background: rgba(52, 152, 219, 0.1);
    }

    .mobile-refresh-btn.spinning .icon {
        animation: spin 0.8s linear infinite;
    }

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

    /* Make header-content position relative for absolute positioning */
    header .header-content {
        position: relative;
    }

    /* Mobile tag select */
    .mobile-tag-select {
        flex: 1;
        height: 36px;
        padding: 0 28px 0 10px;
        border-radius: 8px;
        border: 1px solid #ecf0f1;
        background: white;
        font-size: 13px;
        cursor: pointer;
        color: #7f8c8d;
        outline: none;
        transition: all 0.2s;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237f8c8d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 8px center;
    }

    .mobile-tag-select:focus {
        border-color: #3498db;
        color: #3498db;
    }

    /* Tags filter mobile layout */
    .tags-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .tags-controls {
        flex-wrap: wrap;
        gap: 6px;
    }

    .tags-controls .issues-select {
        flex: 1;
        min-width: 0;
    }

    .tags-controls .compact-select {
        flex-shrink: 0;
    }

    .page-card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .page-card-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .stats-card-gradient {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
    }

    .stats-card-gradient .stat-item {
        min-width: unset;
        width: 100%;
    }

    .stats-card-gradient .value {
        font-size: 24px;
    }

    .list-item {
        padding: 12px 15px;
    }

    .list-item-icon {
        width: 36px;
        height: 36px;
    }

    .list-item-icon .icon {
        width: 16px;
        height: 16px;
    }

    .filter-pills {
        gap: 6px;
    }

    .filter-pill {
        padding: 6px 12px;
        font-size: 13px;
    }

    .data-table thead th {
        padding: 10px 12px;
        font-size: 11px;
    }

    .data-table tbody td {
        padding: 12px;
        font-size: 13px;
    }

    .account-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .account-card-actions {
        width: 100%;
    }

    .account-card-actions .btn {
        flex: 1;
    }

    .timeline {
        padding-left: 20px;
    }

    .timeline::before {
        left: 5px;
    }

    .timeline-item {
        margin-left: 15px;
        padding: 12px 15px;
    }

    .timeline-item::before {
        left: -25px;
        width: 10px;
        height: 10px;
    }

    .info-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .info-card {
        padding: 15px;
    }

    .info-card-value {
        font-size: 22px;
    }

    .modal-box {
        margin: 10px;
        max-width: none;
    }

    .modal-box-header,
    .modal-box-body,
    .modal-box-footer {
        padding: 15px;
    }
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-size: var(--font-size-base);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 280px;
    max-width: 420px;
    animation: toast-in 0.3s ease-out;
    cursor: pointer;
}

.toast.toast-removing {
    animation: toast-out 0.3s ease-in forwards;
}

.toast-success {
    background: var(--color-success-bg);
    color: var(--color-success-text);
    border: 1px solid var(--color-success);
}

.toast-error {
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
    border: 1px solid var(--color-danger);
}

.toast-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
    border: 1px solid var(--color-warning);
}

.toast-info {
    background: var(--color-info-bg);
    color: var(--color-info-text);
    border: 1px solid var(--color-info);
}

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

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

@media (max-width: 768px) {
    .toast-container {
        top: auto;
        bottom: 70px;
        right: 8px;
        left: 8px;
    }

    .toast {
        min-width: unset;
        max-width: unset;
    }
}
