/* Visitor Tracker Admin Dashboard v3 */

.vt-dashboard {
    max-width: 1400px;
}

/* Stats Grid */
.vt-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.vt-stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.vt-stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.vt-stat-card.vt-live {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
}

.vt-stat-card.vt-live .vt-stat-label,
.vt-stat-card.vt-live .vt-stat-sub {
    color: rgba(255,255,255,0.9);
}

.vt-stat-card.vt-live .vt-stat-icon {
    color: rgba(255,255,255,0.5);
}

.vt-stat-icon {
    color: #d1d5db;
    margin-bottom: 8px;
}

.vt-stat-icon svg {
    width: 28px;
    height: 28px;
}

.vt-stat-number {
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
}

.vt-stat-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.vt-stat-sub {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Grid Layout */
.vt-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

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

/* Cards */
.vt-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.vt-card h2 {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vt-card h2 svg {
    flex-shrink: 0;
    color: #9ca3af;
}

/* Chart Card */
.vt-chart-card {
    margin-bottom: 20px;
}

.vt-chart-container {
    position: relative;
    height: 280px;
}

/* Map Card */
.vt-map-card {
    margin-bottom: 20px;
}

#vt-map {
    border: 1px solid #e5e7eb;
}

/* Tables */
.vt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.vt-table th,
.vt-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.vt-table th {
    font-weight: 600;
    color: #6b7280;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vt-table tbody tr:hover {
    background: #f9fafb;
}

.vt-table a {
    color: #2563eb;
    text-decoration: none;
}

.vt-table a:hover {
    text-decoration: underline;
}

.vt-table code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

/* Status Indicators */
.vt-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.vt-status-active {
    background: #d1fae5;
    color: #059669;
    animation: pulse 2s infinite;
}

.vt-status-idle {
    background: #fef3c7;
    color: #d97706;
}

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

/* Device Tags */
.vt-device {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.vt-device-desktop {
    background: #dbeafe;
    color: #1d4ed8;
}

.vt-device-mobile {
    background: #fce7f3;
    color: #be185d;
}

.vt-device-tablet {
    background: #f3e8ff;
    color: #7c3aed;
}

/* Refresh Indicator */
.vt-refresh-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: blink 1s infinite;
    margin-left: 4px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ===== List Items (Top Pages, Referrers) ===== */
.vt-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vt-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    transition: background 0.15s;
}

.vt-list-item:hover {
    background: #f9fafb;
}

.vt-list-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: #f0f7ff;
    border-radius: 6px;
    z-index: 0;
    transition: width 0.3s ease;
}

.vt-list-bar.vt-bar-blue {
    background: #eef2ff;
}

.vt-list-label {
    position: relative;
    z-index: 1;
    flex: 1;
    font-size: 13px;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

a.vt-list-label {
    color: #2563eb;
}

a.vt-list-label:hover {
    text-decoration: underline;
}

.vt-list-value {
    position: relative;
    z-index: 1;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    min-width: 30px;
    text-align: right;
}

.vt-ref-initial {
    position: relative;
    z-index: 1;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: #e0e7ff;
    color: #4338ca;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.vt-empty {
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
    padding: 20px;
    margin: 0;
}

/* ===== Breakdown (Devices, Browsers) ===== */
.vt-breakdown {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.vt-breakdown-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vt-breakdown-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vt-breakdown-icon {
    color: #6b7280;
    display: flex;
    align-items: center;
}

.vt-breakdown-icon svg {
    width: 18px;
    height: 18px;
}

.vt-breakdown-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.vt-breakdown-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.vt-breakdown-pct {
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
}

.vt-breakdown-count {
    font-size: 12px;
    color: #9ca3af;
    min-width: 28px;
    text-align: right;
}

.vt-progress {
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
}

.vt-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
    min-width: 2px;
}

/* ===== Premium/Free Badges ===== */
.vt-free-badge,
.vt-premium-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 10px;
    vertical-align: middle;
}

.vt-free-badge {
    background: #f3f4f6;
    color: #6b7280;
}

.vt-premium-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
}

/* ===== Premium Lock Overlay ===== */
.vt-premium-locked {
    position: relative;
}

.vt-premium-locked .vt-blurred {
    filter: blur(3px);
    pointer-events: none;
    user-select: none;
}

.vt-lock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 24px 32px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    z-index: 10;
    min-width: 260px;
}

.vt-lock-small {
    padding: 16px 24px;
    min-width: auto;
}

.vt-lock-overlay .dashicons-lock {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #f59e0b;
    margin-bottom: 8px;
}

.vt-lock-small .dashicons-lock {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.vt-lock-overlay a {
    display: inline-block;
    margin-top: 8px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    padding: 6px 18px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.vt-lock-overlay a:hover {
    opacity: 0.9;
}

/* ===== Filter Bar ===== */
.vt-filter-bar {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 14px 20px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.vt-filter-bar label {
    font-weight: 500;
    color: #374151;
    font-size: 13px;
}

.vt-filter-bar input[type="date"] {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}

.vt-filter-bar .button {
    margin-left: 10px;
}

/* ===== Country Grid ===== */
.vt-country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.vt-country-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    transition: all 0.15s;
}

.vt-country-item:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.vt-country-flag {
    font-size: 22px;
    line-height: 1;
}

.vt-country-name {
    flex: 1;
    font-weight: 500;
    color: #1f2937;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vt-country-count {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}

/* ===== Upgrade Banner ===== */
.vt-upgrade-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.vt-upgrade-banner .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #d97706;
}

.vt-upgrade-banner-content { flex: 1; }

.vt-upgrade-banner h3 {
    margin: 0 0 5px;
    color: #92400e;
    font-size: 16px;
}

.vt-upgrade-banner p {
    margin: 0;
    color: #78350f;
    font-size: 13px;
}

/* ===== License Settings ===== */
.vt-license-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.vt-license-section h3 {
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .vt-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .vt-grid-2x2 {
        grid-template-columns: repeat(2, 1fr);
    }
    .vt-country-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 782px) {
    .vt-stats-grid,
    .vt-grid,
    .vt-grid-2x2 {
        grid-template-columns: 1fr;
    }

    .vt-stat-number {
        font-size: 32px;
    }

    .vt-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .vt-filter-bar .button {
        margin-left: 0;
        margin-top: 10px;
    }

    .vt-country-grid {
        grid-template-columns: 1fr;
    }

    .vt-upgrade-banner {
        flex-direction: column;
        text-align: center;
    }

    .vt-lock-overlay {
        min-width: auto;
        width: 90%;
        padding: 20px;
    }

    .vt-chart-container {
        height: 200px;
    }
}
