/**
 * Admin styles for Live Visitor Monitor.
 *
 * @package LiveVisitorMonitor
 */

.lvmon8s-wrap {
    margin: 20px 20px 0 0;
}

/* Stats overlay on map */
#lvmon8s-map-container {
    position: relative;
    flex: 1;
    height: 100%;
}

#lvmon8s-stats-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 16px 20px;
    z-index: 1000;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.lvmon8s-stat-line {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.lvmon8s-stat-line:last-of-type {
    margin-bottom: 12px;
}

.lvmon8s-stat-icon {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    flex-shrink: 0;
}

.lvmon8s-stat-line span:not(.lvmon8s-stat-icon) {
    font-weight: 500;
}

#lvmon8s-online-count,
#lvmon8s-active-count {
    font-weight: 600;
    color: #fff;
}

.lvmon8s-stat-footer {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    text-align: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#lvmon8s-dashboard {
    background: #f0f0f1;
    border-radius: 4px;
    overflow: hidden;
}

#lvmon8s-main-content {
    display: flex;
    height: calc(100vh - 280px);
    min-height: 600px;
    background: #fff;
}

#lvmon8s-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.lvmon8s-map-disabled-message {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f7f7;
    border: 1px dashed #ccd0d4;
    border-radius: 4px;
    min-height: 400px;
}

.lvmon8s-map-disabled-message p {
    color: #646970;
    font-size: 16px;
    margin: 0;
}

#lvmon8s-sidebar {
    width: 380px;
    background: #fff;
    border-left: 1px solid #ccd0d4;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lvmon8s-sidebar-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ccd0d4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f6f7f7;
}

.lvmon8s-sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

#lvmon8s-visitors-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.lvmon8s-visitors-list .lvmon8s-loading,
.lvmon8s-visitors-list .lvmon8s-empty {
    padding: 20px;
    text-align: center;
    color: #646970;
}

.lvmon8s-visitor-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lvmon8s-visitor-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    transition: background-color 0.2s;
}

.lvmon8s-visitor-item.lvmon8s-has-location {
    cursor: pointer;
}

.lvmon8s-visitor-item:hover {
    background-color: #f6f7f7;
}

.lvmon8s-visitor-info {
    flex: 1;
    min-width: 0;
}

.lvmon8s-visitor-location {
    margin-bottom: 8px;
}

.lvmon8s-visitor-location strong {
    font-size: 14px;
    color: #1d2327;
}

.lvmon8s-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 7px;
    background: #00a32a;
    border-radius: 50%;
    vertical-align: 1px;
}

.lvmon8s-visitor-live .lvmon8s-live-dot {
    animation: lvmon8s-blink 1s infinite;
}

.lvmon8s-visitor-away .lvmon8s-live-dot {
    background: #8c8f94;
}

.lvmon8s-visitor-location small {
    color: #646970;
    font-size: 12px;
}

.lvmon8s-visitor-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lvmon8s-visitor-country {
    font-size: 12px;
    color: #2271b1;
}

.lvmon8s-visitor-page {
    font-size: 12px;
    color: #646970;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lvmon8s-visitor-time {
    font-size: 11px;
    color: #8c8f94;
}

.lvmon8s-block-btn,
.lvmon8s-unblock-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Map marker styles */
.lvmon8s-marker {
    background: transparent;
    border: none;
}

.lvmon8s-marker-pin {
    width: 20px;
    height: 20px;
    background: #8c8f94;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.lvmon8s-marker-live .lvmon8s-marker-pin {
    background: #00a32a;
    animation: lvmon8s-map-blink 1s infinite, pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 163, 42, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 163, 42, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 163, 42, 0);
    }
}

@keyframes lvmon8s-map-blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.35;
    }
}

@keyframes lvmon8s-blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.25;
    }
}

.lvmon8s-popup {
    font-size: 13px;
    line-height: 1.5;
}

.lvmon8s-popup strong {
    display: block;
    margin-bottom: 5px;
    color: #1d2327;
}

.lvmon8s-popup small {
    color: #646970;
    display: block;
    margin-top: 5px;
}

/* Blocked IPs section */
.lvmon8s-blocked-section {
    border-top: 1px solid #ccd0d4;
    padding: 15px 20px;
    background: #f6f7f7;
}

.lvmon8s-blocked-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
}

.lvmon8s-blocked-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lvmon8s-blocked-list li {
    padding: 10px 0;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lvmon8s-blocked-list li:last-child {
    border-bottom: none;
}

.lvmon8s-blocked-ip {
    font-family: monospace;
    font-size: 13px;
    color: #d63638;
    font-weight: 600;
}

.lvmon8s-blocked-reason {
    font-size: 12px;
    color: #646970;
}

/* Settings page styles */
.lvmon8s-settings-page {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    overflow: hidden;
}

.lvmon8s-settings-nav {
    width: 220px;
    background: #f6f7f7;
    border-right: 1px solid #ccd0d4;
    flex-shrink: 0;
}

.lvmon8s-settings-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lvmon8s-settings-menu li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #e5e5e5;
}

.lvmon8s-settings-menu li:last-child {
    border-bottom: none;
}

.lvmon8s-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #50575e;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.lvmon8s-nav-item:hover {
    background: #fff;
    color: #2271b1;
}

.lvmon8s-nav-item.active {
    background: #fff;
    color: #2271b1;
    border-left-color: #2271b1;
    font-weight: 600;
}

.lvmon8s-nav-item .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.lvmon8s-settings-content {
    flex: 1;
    padding: 20px;
    min-width: 0;
}

.lvmon8s-settings-section {
    margin-bottom: 30px;
}

.lvmon8s-settings-section:last-child {
    margin-bottom: 0;
}

.lvmon8s-settings-section h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccd0d4;
}

.lvmon8s-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.lvmon8s-toggle input[type="checkbox"] {
    width: 40px;
    height: 20px;
    cursor: pointer;
}

.lvmon8s-toggle-label {
    font-weight: 500;
    cursor: pointer;
}

/* Blocklist page styles */
.lvmon8s-page-title-row {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.lvmon8s-page-title-row h1 {
    margin-bottom: 0;
}

.lvmon8s-blocklist-hero {
    align-items: center;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin-top: 20px;
    padding: 22px 24px;
}

.lvmon8s-blocklist-hero h2 {
    margin: 0 0 8px;
}

.lvmon8s-blocklist-hero p {
    color: #50575e;
    font-size: 14px;
    margin: 0;
    max-width: 760px;
}

.lvmon8s-blocklist-count {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    min-width: 150px;
    padding: 14px 18px;
    text-align: center;
}

.lvmon8s-blocklist-count span {
    color: #646970;
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.lvmon8s-blocklist-count strong {
    color: #1d2327;
    display: block;
    font-size: 34px;
    line-height: 1.1;
    margin-top: 5px;
}

.lvmon8s-manual-block-form {
    display: grid;
    gap: 10px;
    max-width: 520px;
}

.lvmon8s-manual-block-form label {
    font-weight: 600;
}

.lvmon8s-manual-block-form input {
    max-width: 100%;
    width: 100%;
}

.lvmon8s-manual-block-form .button {
    justify-self: start;
    margin-top: 4px;
}

.lvmon8s-blocklist-page {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-top: 20px;
}

.lvmon8s-blocklist-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.lvmon8s-blocklist-header h2 {
    margin: 0 0 4px;
}

.lvmon8s-empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #646970;
}

.lvmon8s-empty-state .dashicons {
    color: #8c8f94;
    font-size: 40px;
    height: 40px;
    width: 40px;
}

.lvmon8s-empty-state h2 {
    color: #1d2327;
    margin: 10px 0 6px;
}

.lvmon8s-blocklist-page .wp-list-table {
    margin-top: 0;
}

.lvmon8s-blocklist-page .column-status {
    width: 12%;
}

.lvmon8s-blocklist-page .column-ip {
    width: 22%;
}

.lvmon8s-blocklist-page .column-reason {
    width: 34%;
}

.lvmon8s-blocklist-page .column-date {
    width: 20%;
}

.lvmon8s-blocklist-page .column-actions {
    width: 14%;
    text-align: right;
}

.lvmon8s-status-blocked {
    background: #fcf0f1;
    border: 1px solid #ffabaf;
    border-radius: 4px;
    color: #8a2424;
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 5px 8px;
}

.lvmon8s-modal-backdrop {
    align-items: center;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 100000;
}

.lvmon8s-modal-backdrop.is-open {
    display: flex;
}

.lvmon8s-modal {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
    max-width: 560px;
    padding: 22px;
    width: 100%;
}

.lvmon8s-modal-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.lvmon8s-modal-header h2 {
    margin: 0;
}

.lvmon8s-modal-close .dashicons {
    color: #50575e;
}

.lvmon8s-modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

/* Upgrade page styles */
.lvmon8s-upgrade-page {
    margin-top: 20px;
}

.lvmon8s-upgrade-hero {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 24px;
}

.lvmon8s-upgrade-hero h2 {
    margin-top: 0;
}

.lvmon8s-upgrade-badge {
    background: #edfaef;
    border: 1px solid #68de7c;
    border-radius: 4px;
    color: #006b2b;
    display: inline-block;
    font-weight: 600;
    padding: 7px 10px;
}

.lvmon8s-upgrade-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 16px;
}

.lvmon8s-upgrade-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 18px;
}

.lvmon8s-upgrade-card h3 {
    margin-top: 0;
}

.lvmon8s-upgrade-support {
    margin-top: 28px;
}

.lvmon8s-upgrade-support h2 {
    margin-bottom: 12px;
}

/* Responsive adjustments */
@media screen and (max-width: 1200px) {
    .lvmon8s-blocklist-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .lvmon8s-blocklist-count {
        text-align: left;
    }

    .lvmon8s-page-title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    #lvmon8s-main-content {
        flex-direction: column;
        height: auto;
    }

    #lvmon8s-map-container {
        height: 500px;
    }

    #lvmon8s-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #ccd0d4;
        max-height: 400px;
    }

    #lvmon8s-stats-overlay {
        bottom: 10px;
        left: 10px;
        min-width: 180px;
        padding: 12px 16px;
    }

    .lvmon8s-stat-line {
        font-size: 12px;
    }
}
