/**
 * Thor Tracker - Admin Styles
 * Optimized CSS with extracted inline styles
 */

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

caption.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   CSS CUSTOM PROPERTIES (THEME)
   ========================================================================== */

:root {
    /* Primary colors */
    --mtcam-primary: #2271b1;
    --mtcam-danger: #d63638;
    --mtcam-success: #4CAF50;
    --mtcam-warning: #dba617;
    --mtcam-info: #2196F3;
    --mtcam-accent: #9C27B0;

    /* Text */
    --mtcam-text: #1d2327;
    --mtcam-text-muted: #666;
    --mtcam-text-light: #999;

    /* Backgrounds */
    --mtcam-bg: #f8f9fa;
    --mtcam-bg-card: #fff;
    --mtcam-bg-info: #e3f2fd;
    --mtcam-bg-danger: #ffebee;
    --mtcam-bg-warning: #fff3cd;
    --mtcam-bg-success: #d4edda;

    /* Borders & Surfaces */
    --mtcam-border: #c3c4c7;
    --mtcam-border-light: #ddd;
    --mtcam-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --mtcam-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);

    /* Spacing */
    --mtcam-gap: 12px;
    --mtcam-gap-lg: 20px;
    --mtcam-radius: 8px;
    --mtcam-radius-sm: 4px;

    /* Transitions */
    --mtcam-transition: 0.2s ease;
}

/* ==========================================================================
   MODERN CSS ENHANCEMENTS
   ========================================================================== */

/* Better typography */
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

/* :has() powered contextual styles */
tr:has(.mtcam-detection-badge) { background: var(--mtcam-bg-danger); }
tr:has(.mtcam-status-test) { background: #f3e5f5; }
.mtcam-edit-field:has(input:focus) { background: var(--mtcam-bg-info); border-radius: var(--mtcam-radius-sm); }

/* Snow cover warning */
.mtcam-snow-warning {
    background: linear-gradient(135deg, #e3f2fd 0%, #e8eaf6 100%);
    border: 1px solid #90caf9;
    border-left: 4px solid var(--mtcam-info);
    padding: 12px 16px;
    border-radius: var(--mtcam-radius-sm);
    margin: 12px 0;
    font-size: 13px;
    line-height: 1.5;
    color: #1a237e;
}

/* Camera profile autocomplete */
.mtcam-profile-autocomplete-wrap {
    position: relative;
}

.mtcam-profile-input {
    width: 100%;
    max-width: 500px;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--mtcam-border);
    border-radius: var(--mtcam-radius-sm);
    background: #fff;
}

.mtcam-profile-dropdown {
    position: absolute;
    z-index: 1000;
    width: 100%;
    max-width: 500px;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--mtcam-border);
    border-top: none;
    border-radius: 0 0 var(--mtcam-radius-sm) var(--mtcam-radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.mtcam-profile-dropdown-group {
    padding: 6px 12px 2px;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: .3px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.mtcam-profile-dropdown-item {
    padding: 7px 12px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mtcam-profile-dropdown-item:hover,
.mtcam-profile-dropdown-item.active {
    background: var(--mtcam-bg-info);
}

.mtcam-profile-dropdown-item small {
    color: #888;
    font-size: 11px;
}

.mtcam-profile-dropdown-empty {
    padding: 12px;
    font-size: 13px;
    color: #999;
    text-align: center;
}

.mtcam-profile-tip {
    margin-top: 8px;
    padding: 10px 14px;
    background: var(--mtcam-bg-info);
    border-left: 3px solid var(--mtcam-info);
    border-radius: var(--mtcam-radius-sm);
    font-size: 13px;
    color: var(--mtcam-text);
    line-height: 1.4;
}

/* Nesting-compatible utility transitions */
.mtcam-tab,
.mtcam-status-badge,
.mtcam-maint-btn,
button {
    transition: all var(--mtcam-transition);
}

/* ==========================================================================
   DASHBOARD STYLES
   ========================================================================== */

/* Info Grid - 4 Columns */
.mtcam-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 5px;
    background: var(--mtcam-bg);
    border-radius: 6px;
}

.mtcam-info-table {
    width: 100%;
    font-size: 13px;
}

.mtcam-info-table tr td:first-child {
    padding: 5px 0;
    color: var(--mtcam-text-muted);
    width: 120px;
}

.mtcam-info-table tr td:last-child {
    padding: 5px 0;
}

/* Status Badges */
.mtcam-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--mtcam-radius-sm);
    font-weight: 600;
    font-size: 12px;
}

.mtcam-status-stolen {
    background: var(--mtcam-bg-danger);
    color: #c62828;
}

.mtcam-status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.mtcam-status-test {
    background: #fff9c4;
    color: #f57f17;
}

.mtcam-status-home {
    background: #e3f2fd;
    color: #1565c0;
}

.mtcam-status-date {
    display: inline;
    margin-left: 6px;
    color: var(--mtcam-text-light);
    font-size: 11px;
    font-weight: normal;
}

.mtcam-police-badge {
    display: inline-block;
    background: #1976d2;
    color: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
}

/* File/Security Badges */
.mtcam-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    margin: 2px;
    font-size: 11px;
    font-weight: bold;
}

.mtcam-badge-file {
    background: var(--mtcam-bg-info);
    color: #1976d2;
}

.mtcam-badge-gps {
    background: var(--mtcam-bg-warning);
    color: #856404;
}

/* Text Helpers */
.mtcam-text-muted {
    color: var(--mtcam-text-light);
}

.mtcam-text-small {
    font-size: 11px;
}

/* ==========================================================================
   SETTINGS PAGE STYLES
   ========================================================================== */

/* Tabs - Updated version */
.mtcam-tabs {
    display: flex;
    gap: 0;
    margin: 20px 0 0 0;
    border-bottom: 1px solid var(--mtcam-border);
}

.mtcam-tab {
    padding: 12px 24px;
    background: var(--mtcam-bg);
    border: 1px solid var(--mtcam-border);
    border-bottom: none;
    cursor: pointer;
    font-weight: 500;
    color: var(--mtcam-text-muted);
    border-radius: 4px 4px 0 0;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.mtcam-tab:hover {
    background: #e8e8e8;
}

.mtcam-tab.active {
    background: #fff;
    color: #000;
    border-bottom: 1px solid var(--mtcam-bg-card);
}

.mtcam-tab-content {
    display: none;
    padding: 20px 24px;
    background: var(--mtcam-bg-card);
    border: 1px solid var(--mtcam-border);
    border-top: none;
}

.mtcam-tab-content.active {
    display: block;
}

/* Info/Tip Boxes */
.mtcam-tip-box {
    padding: 15px;
    margin-top: 20px;
    border-radius: var(--mtcam-radius-sm);
    border-left: 4px solid;
}

.mtcam-tip-box h3 {
    margin-top: 0;
}

.mtcam-tip-box ul {
    margin: 0;
}

.mtcam-tip-box-blue {
    background: #E3F2FD;
    border-color: var(--mtcam-info);
}

.mtcam-tip-box-yellow {
    background: #FFF3CD;
    border-color: #FFC107;
}

.mtcam-tip-box-red {
    background: var(--mtcam-bg-danger);
    border-color: var(--mtcam-danger);
}

/* Code/API Display Boxes */
.mtcam-code-box {
    background: var(--mtcam-bg);
    padding: 15px;
    border-radius: var(--mtcam-radius-sm);
    font-family: monospace;
    word-break: break-all;
}

.mtcam-white-box {
    background: #fff;
    border: 1px solid var(--mtcam-border-light);
    padding: 20px;
    margin: 20px 0;
    border-radius: 6px;
}

.mtcam-white-box-clean {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 6px;
    padding: 25px;
    margin: 20px 0;
}

/* Inline Code */
.mtcam-code-inline {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

/* Copy Button */
.mtcam-copy-button {
    margin-top: 10px;
    padding: 8px 15px;
    background: var(--mtcam-primary);
    color: #fff;
    border: none;
    border-radius: var(--mtcam-radius-sm);
    cursor: pointer;
    font-size: 13px;
}

.mtcam-copy-button:hover {
    background: #135e96;
}

/* Widget Box */

.mtcam-widget-box {
    padding: 20px;
    border-radius: var(--mtcam-radius);
    border: 2px solid;
}

.mtcam-widget-box-stolen {
    background: var(--mtcam-bg-danger);
    border-color: var(--mtcam-danger);
}

.mtcam-widget-box-active {
    background: #e8f5e9;
    border-color: var(--mtcam-success);
}

.mtcam-widget-box h4 {
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid;
}

.mtcam-widget-box-stolen h4 {
    color: var(--mtcam-danger);
    border-color: var(--mtcam-danger);
}

.mtcam-widget-box-active h4 {
    color: #2e7d32;
    border-color: var(--mtcam-success);
}

.mtcam-widget-checkbox-list {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
}

.mtcam-widget-checkbox-list label {
    display: block;
    margin: 8px 0;
    font-size: 13px;
}

/* Edit Form Grid */
.mtcam-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.mtcam-edit-section {
    background: var(--mtcam-bg);
    padding: 10px;
    border-radius: 6px;
}

.mtcam-edit-section h5 {
    margin: 0 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 2px solid;
    font-size: 13px;
}

.mtcam-edit-field {
    margin-bottom: 6px;
}

.mtcam-edit-field label {
    display: block;
    font-weight: bold;
    margin-bottom: 2px;
    font-size: 12px;
}

.mtcam-edit-field input[type="text"],
.mtcam-edit-field input[type="date"],
.mtcam-edit-field input[type="number"],
.mtcam-edit-field input[type="email"],
.mtcam-edit-field select {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--mtcam-border-light);
    border-radius: 3px;
    font-size: 13px;
}

.mtcam-edit-field small {
    font-size: 11px;
    color: #646970;
}

/* 3-Column Grid for Files/Security/GPS */
.mtcam-edit-grid-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

/* ==========================================================================
   ADMIN LOG STYLES
   ========================================================================== */

/* Owner Badge */
.mtcam-owner-badge {
    display: inline-block;
    background: var(--mtcam-info);
    color: #fff;
    padding: 4px 8px;
    border-radius: var(--mtcam-radius-sm);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* Section Headers */
.mtcam-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--mtcam-gap);
    margin: 0 0 var(--mtcam-gap) 0;
}

.mtcam-section-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--mtcam-text);
}

.mtcam-section-actions {
    display: flex;
    align-items: center;
    gap: var(--mtcam-gap);
    flex-wrap: wrap;
}

.mtcam-cell-top {
    vertical-align: top;
}

.mtcam-details-row {
    background: #f8f9fa !important;
}

.mtcam-camera-badge {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
	background: var(--cam-color, #9C27B0);
    color: #fff;
    border-radius: var(--mtcam-radius-sm);
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.mtcam-mt-0 { margin-top: 0; }
.mtcam-mt-10 { margin-top: 10px; }
.mtcam-mt-15 { margin-top: 15px; }
.mtcam-mt-20 { margin-top: 20px; }
.mtcam-mt-30 { margin-top: 30px; }

.mtcam-ml-20 { margin-left: 20px; }

.mtcam-font-bold { font-weight: 600; }

.mtcam-icon-lg {
    font-size: 30px;
    vertical-align: middle;
}

.mtcam-input-sm {
    width: 80px;
}

/* Responsive */
@media (max-width: 1200px) {
    .mtcam-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .mtcam-info-grid,
    .mtcam-edit-grid,
    .mtcam-edit-grid-3col {
        grid-template-columns: 1fr;
    }
    
    .mtcam-tabs {
        flex-direction: column;
    }
    
    .mtcam-tab {
        border-radius: 6px;
    }
}

/* Clickable table rows */
.wp-list-table tbody tr[onclick] {
    transition: background-color 0.2s ease;
}

.wp-list-table tbody tr[onclick]:hover {
    background-color: #f0f6fc !important;
}

/* Rows with detections - red border */
.wp-list-table tbody tr.mtcam-has-detections {
    border-left: 4px solid var(--mtcam-danger);
}

.wp-list-table tbody tr.mtcam-has-detections:hover {
    background-color: #fff5f5 !important;
}

/* Detection badge */
.mtcam-detection-badge {
    display: inline-block;
    background: #d63638;
    color: #fff;
    padding: 4px 10px;
    border-radius: var(--mtcam-radius-sm);
    font-weight: 600;
    font-size: 13px;
    animation: mtcam-pulse-alert 1.5s ease-in-out infinite;
}

/* ==========================================================================
   EXTRACTED INLINE STYLES
   ========================================================================== */

/* --- Layout --- */
.mtcam-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mtcam-flex-center {
    display: flex;
    align-items: center;
}

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

.mtcam-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.mtcam-grid-3col-battery {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.mtcam-full-width-row {
    grid-column: 1 / -1;
}

/* --- Dashboard Welcome --- */
.mtcam-welcome-box {
    background: #fff;
    border: 1px solid var(--mtcam-border-light);
    border-radius: var(--mtcam-radius);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.mtcam-welcome-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 25px;
}

.mtcam-welcome-card {
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    padding: 18px;
    border-radius: 0 6px 6px 0;
    transition: background 0.15s, box-shadow 0.15s;
}

a.mtcam-welcome-card {
    display: block;
    text-decoration: none;
    cursor: pointer;
}

a.mtcam-welcome-card:hover,
a.mtcam-welcome-card:focus {
    background: #e4eef8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.mtcam-welcome-card h4 {
    margin: 0 0 8px 0;
    color: var(--mtcam-primary);
}

.mtcam-welcome-card p {
    margin: 0;
    font-size: 13px;
    color: var(--mtcam-text-muted);
    line-height: 1.5;
}

.mtcam-welcome-steps {
    border-left: 3px solid #2271b1;
    margin: 15px 0 25px 12px;
    padding-left: 0;
}

.mtcam-welcome-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0 12px 20px;
    position: relative;
}

.mtcam-welcome-step + .mtcam-welcome-step {
    border-top: 1px solid #eee;
}

.mtcam-welcome-step-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: #2271b1;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
    margin-left: -34px;
}

.mtcam-welcome-step div strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.mtcam-welcome-step div strong a {
    color: var(--mtcam-primary);
    text-decoration: none;
}

.mtcam-welcome-step div strong a:hover {
    text-decoration: underline;
}

.mtcam-welcome-step div p {
    margin: 0;
    font-size: 13px;
    color: var(--mtcam-text-muted);
    line-height: 1.5;
}

.mtcam-welcome-cta {
    margin-top: 25px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.mtcam-welcome-cta .button {
    font-size: 15px;
    padding: 10px 30px;
    height: auto;
}

.mtcam-welcome-cta p {
    color: #888;
    font-size: 12px;
    margin-top: 10px;
}

/* --- Dashboard Damage Widget --- */
.mtcam-damage-widget {
    background: var(--mtcam-danger);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--mtcam-radius);
    text-align: center;
    box-shadow: 0 4px 10px rgba(211,47,47,0.3);
}

.mtcam-damage-label {
    font-size: 11px;
    opacity: 0.9;
    margin-bottom: 3px;
}

.mtcam-damage-amount {
    font-size: 22px;
    font-weight: bold;
}

.mtcam-damage-count {
    font-size: 10px;
    opacity: 0.85;
    margin-top: 2px;
}

/* --- Nastavenia: Checkbox List --- */
.mtcam-checkbox-label {
    display: block;
    margin: 8px 0;
    font-size: 13px;
}

/* --- Nastavenia: System Info Table --- */
.mtcam-sysinfo-table {
    width: 100%;
    font-size: 14px;
}

.mtcam-sysinfo-table td {
    padding: 10px 0;
}

.mtcam-sysinfo-table tr {
    border-bottom: 1px solid var(--mtcam-border-light);
}

.mtcam-sysinfo-table tr:last-child {
    border-bottom: none;
}

.mtcam-sysinfo-table td:first-child {
    font-weight: bold;
}

/* --- Nastavenia: Maintenance Buttons --- */
.mtcam-maint-btn {
    padding: 10px 20px;
    color: #fff;
    border: none;
    border-radius: var(--mtcam-radius-sm);
    cursor: pointer;
    margin-right: 10px;
    font-size: 14px;
    transition: opacity 0.2s, transform 0.2s;
}

.mtcam-maint-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.mtcam-maint-btn-orange { background: var(--mtcam-warning); }
.mtcam-maint-btn-red { background: #f44336; }
.mtcam-maint-btn-green { background: var(--mtcam-success); }
.mtcam-maint-btn-blue { background: var(--mtcam-info); }

/* --- Nastavenia: Warning Box --- */
.mtcam-warning-box {
    background: #FFF3CD;
    border-left: 4px solid #FFC107;
    padding: 15px;
    border-radius: var(--mtcam-radius-sm);
    margin-bottom: 15px;
}

/* --- Nastavenia: Section Borders --- */
.mtcam-section-border-blue {
    margin-top: 30px;
    border-bottom: 2px solid #2196F3;
    padding-bottom: 10px;
}

.mtcam-section-border-gray {
    margin-top: 40px;
    border-bottom: 2px solid #666;
    padding-bottom: 10px;
}

/* --- Nastavenia: Sticky Save Button --- */
.mtcam-sticky-save {
    position: sticky;
    bottom: 0;
    background: var(--mtcam-bg);
    padding: 15px 20px;
    margin: 0 -20px;
    border-top: 2px solid #ccc;
    z-index: 10;
}

.mtcam-sticky-save .button {
    font-size: 14px;
    padding: 8px 25px;
    height: auto;
}

/* --- Accessories Form --- */
.mtcam-acc-row {
    display: flex;
    align-items: center;
    margin: 3px 0;
    font-size: 12px;
}

.mtcam-acc-row input[type="checkbox"] {
    margin-right: 5px;
}

.mtcam-acc-row input[type="number"] {
    width: 70px;
    margin-left: auto;
    padding: 3px 4px;
    font-size: 12px;
}

.mtcam-acc-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #ddd;
}

/* Subgroup heading inside the merged Price & Accessories column. */
.mtcam-acc-subgroup {
    margin: 10px 0 4px;
    padding-top: 8px;
    border-top: 1px solid #e5e5e5;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.mtcam-acc-total {
    margin-top: 6px;
    padding: 5px 8px;
    background: var(--mtcam-bg);
    border-radius: 3px;
    font-size: 12px;
}

/* --- Battery Bar --- */
.mtcam-battery-bar-bg {
    flex: 1;
    background: #e0e0e0;
    border-radius: var(--mtcam-radius);
    height: 24px;
    overflow: hidden;
}

.mtcam-battery-bar-fill {
    height: 100%;
    border-radius: var(--mtcam-radius);
    transition: width 0.5s;
}

.mtcam-battery-bar-sm {
    height: 20px;
}

.mtcam-battery-estimate {
    margin-top: 10px;
    padding: 12px;
    background: var(--mtcam-bg);
    border-radius: 6px;
}

/* --- Detection Log Detail --- */
.mtcam-detail-table {
    width: 100%;
    font-size: 14px;
}

.mtcam-detail-table td {
    padding: 8px 0;
}

.mtcam-detail-table td:first-child {
    font-weight: bold;
    color: var(--mtcam-text-muted);
}

.mtcam-detail-separator {
    color: #ccc;
    margin: 0 10px;
}

/* --- Text Colors --- */
.mtcam-text-danger { color: var(--mtcam-danger); }
.mtcam-text-warning { color: #f57c00; }
.mtcam-text-success { color: var(--mtcam-success); }
.mtcam-text-info { color: var(--mtcam-primary); }
.mtcam-text-muted { color: var(--mtcam-text-light); }
.mtcam-text-gray { color: var(--mtcam-text-muted); }

/* --- Font Sizes --- */
.mtcam-text-sm { font-size: 12px; }
.mtcam-text-md { font-size: 14px; }
.mtcam-text-lg { font-size: 18px; }

/* --- Security Item --- */
.mtcam-sec-item {
    display: block;
    margin: 2px 0;
    font-size: 11px;
}

/* --- Map Link --- */
.mtcam-link-map {
    color: var(--mtcam-info);
    text-decoration: none;
}

.mtcam-link-map:hover {
    color: #1976D2;
    text-decoration: underline;
}

/* --- Clickable & Links --- */
.mtcam-clickable { cursor: pointer; }

/* --- Gaps --- */
.mtcam-gap-4 { gap: 4px; }
.mtcam-gap-8 { gap: 8px; }
.mtcam-gap-10 { gap: 10px; }

/* --- Margins --- */
.mtcam-mr-5 { margin-right: 5px; }
.mtcam-mb-8 { margin-bottom: 8px; }

/* --- Hidden Camera Badge --- */
.mtcam-badge-hidden {
    background: #ddd;
    color: var(--mtcam-text-light);
}

/* --- Border --- */
.mtcam-border-top {
    border-top: 1px solid #ddd;
    padding-top: 4px;
}

/* --- Select Field --- */
.mtcam-select-field {
    width: 100%;
    padding: 6px;
    border: 1px solid var(--mtcam-border-light);
    border-radius: var(--mtcam-radius-sm);
}

/* --- Battery Bar Sizes --- */
.mtcam-battery-bar-xs {
    width: 40px;
    height: 12px;
    border-radius: var(--mtcam-radius-sm);
}

.mtcam-battery-bar-fill-xs {
    border-radius: var(--mtcam-radius-sm);
}

/* ==========================================================================
   DETECTION LOG PAGE
   ========================================================================== */

/* --- Filter Bar --- */
.mtcam-filter-bar {
    background: #f0f6fc;
    border: 2px solid #0969da;
    border-radius: var(--mtcam-radius);
    padding: 15px;
    margin: 20px 0;
}

.mtcam-filter-label {
    font-weight: 600;
    color: var(--mtcam-primary);
}

.mtcam-filter-select {
    padding: 8px 12px;
    border: 2px solid #0969da;
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
}

.mtcam-filter-active {
    background: #fff;
    border: 2px solid #0969da;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    color: var(--mtcam-primary);
}

/* --- Main Container --- */
/* Unified page card — biely kontajner s tieňom pre obsah stránky */
.mtcam-page-card {
    background: var(--mtcam-bg-card);
    border: 1px solid var(--mtcam-border-light);
    border-radius: var(--mtcam-radius);
    padding: 20px 24px;
    box-shadow: var(--mtcam-shadow);
    max-width: 1400px;
}

/* --- Empty State --- */
.mtcam-empty-state {
    text-align: center;
    color: var(--mtcam-text-muted);
    padding: 40px;
}

.mtcam-empty-icon {
    font-size: 48px;
}

/* --- Log Card --- */
.mtcam-log-card {
    background: #fff;
    border: 1px solid var(--mtcam-border-light);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid;
}

.mtcam-log-card:hover {
    background: color-mix(in srgb, var(--mtcam-accent) 6%, #fff);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* --- Detection Grid --- */
.mtcam-det-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* --- Detection Detail Table --- */
.mtcam-det-label {
    padding: 8px 0;
    font-weight: bold;
    color: var(--mtcam-text-muted);
    width: 140px;
}

/* --- Section Titles --- */
.mtcam-det-section-title {
    color: var(--mtcam-text);
    border-bottom: 2px solid #9C27B0;
    padding-bottom: 8px;
}

/* --- Indicators --- */
.mtcam-indicator {
    font-size: 18px;
}

.mtcam-indicator-gps { color: var(--mtcam-success); }

/* --- Factor List --- */
.mtcam-factor-list {
    list-style: none;
    padding: 0;
}

.mtcam-factor-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--mtcam-border-light);
}

/* --- Recovery Bar --- */
.mtcam-recovery-bar-bg {
    background: var(--mtcam-bg);
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    margin: 10px 0;
}

.mtcam-recovery-text {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin: 15px 0;
}

/* --- Action Buttons --- */
.mtcam-btn-danger {
    background: #d63638;
    color: #fff;
    border: none;
}

.mtcam-btn-danger:hover {
    background: #b32d2e;
    color: #fff;
}

.mtcam-btn-delete {
    background: #f44336;
    color: #fff;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: var(--mtcam-radius-sm);
}

.mtcam-btn-delete:hover {
    background: var(--mtcam-danger);
    color: #fff;
}

.mtcam-btn-maps {
    display: inline-block;
    background: var(--mtcam-success);
    color: #fff;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: var(--mtcam-radius-sm);
}

.mtcam-btn-maps:hover {
    background: #43a047;
    color: #fff;
}

.mtcam-det-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

/* --- Utility --- */
.mtcam-flex-1 { flex: 1; }

/* --- Responsive: Detection Page --- */
@media (max-width: 1200px) {
    .mtcam-det-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .mtcam-filter-bar form {
        flex-direction: column;
        align-items: stretch;
    }
    .mtcam-filter-select {
        min-width: unset;
    }
}

/* --- Responsive overrides for new classes --- */
@media (max-width: 1200px) {
    .mtcam-grid-3col-battery {
        grid-template-columns: 1fr;
    }
    .mtcam-welcome-grid,
    .mtcam-grid-2col {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   SCOPED TABLE STYLES (migrated from mtcam-styly.css)
   Scoped to .mtcam-wrap to avoid polluting WP admin
   ========================================================================== */

.mtcam-wrap table {
    width: 100%;
    border-collapse: collapse;
}

.mtcam-wrap table thead tr {
    background: linear-gradient(to bottom, #f8f8f8, #f0f0f0);
    border-bottom: 2px solid var(--mtcam-border-light);
}

.mtcam-wrap table th,
.mtcam-wrap table td {
    padding: 15px;
    text-align: left;
}

.mtcam-wrap table th:nth-child(n+4),
.mtcam-wrap table td:nth-child(n+4) {
    text-align: center;
}

.mtcam-wrap table tbody tr {
    border-bottom: 1px solid var(--mtcam-border-light);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.mtcam-wrap table tbody tr:hover {
    background: linear-gradient(to right, #f9f9f9, #fff);
    transform: translateX(2px);
    box-shadow: inset 3px 0 0 0 var(--cam-color, #2196F3);
}

/* Camera ID badge */
.mtcam-wrap table tbody tr > td:first-child code {
    background: var(--cam-color, #666);
    color: #fff;
    padding: 8px 12px;
    border-radius: var(--mtcam-radius-sm);
    font-weight: 700;
    font-family: 'Courier New', monospace;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Expandable details row */
.mtcam-wrap table tbody tr[id^="details-"] {
    display: none;
    background: #f9f9f9;
    cursor: default;
}

.mtcam-wrap table tbody tr[id^="details-"]:hover {
    transform: none;
    box-shadow: none;
}

.mtcam-wrap table tbody tr[id^="details-"] > td {
    padding: 0 !important;
    border-bottom: 2px solid var(--cam-color, #ddd);
}

.mtcam-wrap table tbody tr[id^="details-"] > td > div {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* Settings form scoped */
.mtcam-wrap .form-table th {
    font-weight: 600;
    color: var(--mtcam-text);
    padding: 15px 0;
}

.mtcam-wrap .form-table td {
    padding: 15px 0;
}

.mtcam-wrap .form-table label {
    cursor: pointer;
    transition: color 0.15s;
}

.mtcam-wrap .form-table label:hover {
    color: var(--mtcam-primary);
}

.mtcam-wrap .form-table input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.15);
    cursor: pointer;
    accent-color: var(--mtcam-primary);
}

.mtcam-wrap .form-table input[type="text"]:focus,
.mtcam-wrap .form-table input[type="date"]:focus,
.mtcam-wrap .form-table input[type="email"]:focus,
.mtcam-wrap .form-table input[type="number"]:focus {
    outline: none;
    border-color: var(--mtcam-primary);
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

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

@keyframes thorSpin {
    to { transform: rotate(360deg); }
}

.mtcam-wrap [aria-busy="true"] {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.mtcam-wrap [aria-busy="true"]::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 28px;
    height: 28px;
    border: 3px solid #dcdcde;
    border-top-color: var(--mtcam-primary);
    border-radius: 50%;
    animation: thorSpin 0.8s linear infinite;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1200px) {
    .mtcam-wrap table tbody tr[id^="details-"] > td > div {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 782px) {
    .mtcam-wrap table th,
    .mtcam-wrap table td {
        padding: 10px;
        font-size: 13px;
    }
    .mtcam-wrap table tbody tr > td:first-child code {
        font-size: 11px;
        padding: 5px 8px;
    }
    .mtcam-wrap table tbody tr[id^="details-"] > td > div {
        grid-template-columns: 1fr;
    }
    .mtcam-wrap .form-table th,
    .mtcam-wrap .form-table td {
        display: block;
        width: 100%;
    }
}

/* ==========================================================================
   PRINT
   ========================================================================== */

@media print {
    .mtcam-wrap {
        box-shadow: none !important;
    }
    .mtcam-wrap table tbody tr:hover {
        background: none;
        transform: none;
        box-shadow: none;
    }
    .mtcam-wrap table tbody tr[id^="details-"] {
        display: table-row !important;
    }
    .mtcam-wrap .mtcam-maint-btn,
    .mtcam-wrap .button {
        display: none;
    }
}

/* ── Planned days progress bar ── */
.mtcam-plan-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}
.mtcam-plan-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s;
}
.mtcam-plan-over .mtcam-plan-fill {
    animation: mtcam-pulse-bar 1.2s ease-in-out infinite;
}
@keyframes mtcam-pulse-bar {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================================================
   LOCATION STATS
   ============================================================================ */
.mtcam-location-stats {
    display: flex;
    gap: var(--mtcam-gap);
    margin: 15px 0;
    flex-wrap: wrap;
}

.mtcam-location-stat {
    background: var(--mtcam-bg-card);
    border: 1px solid var(--mtcam-border-light);
    border-radius: var(--mtcam-radius);
    padding: 16px 24px;
    text-align: center;
    flex: 1;
    min-width: 120px;
    box-shadow: var(--mtcam-shadow);
}

.mtcam-stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--mtcam-primary);
    line-height: 1.2;
}

.mtcam-stat-label {
    display: block;
    font-size: 12px;
    color: var(--mtcam-text-muted);
    margin-top: 4px;
}

.mtcam-stat-excluded {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 12px;
    padding: 2px 8px;
    margin-left: 6px;
    vertical-align: middle;
    cursor: help;
}
.mtcam-stat-label small { font-size: 11px; font-weight: 400; }

/* Score comparison bars */
.mtcam-score-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.mtcam-score-bar-label {
    min-width: 160px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mtcam-score-bar-track {
    flex: 1;
    height: 22px;
    background: var(--mtcam-border-light);
    border-radius: 11px;
    overflow: hidden;
}
.mtcam-score-bar-fill {
    height: 100%;
    border-radius: 11px;
    transition: width 0.6s ease;
}
.mtcam-score-bar-value {
    min-width: 36px;
    font-size: 14px;
    font-weight: 700;
    text-align: right;
}

/* ============================================================================
   ABOUT TAB
   ============================================================================ */

.mtcam-about-hero {
    background: linear-gradient(135deg, #1a2942 0%, #2271b1 65%, #1a6399 100%);
    border-radius: var(--mtcam-radius);
    padding: 26px 30px;
    margin-bottom: 18px;
    box-shadow: 0 4px 20px rgba(34,113,177,0.2);
}
.mtcam-about-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}
.mtcam-about-logo { display: flex; align-items: center; gap: 14px; }
.mtcam-about-logo-icon { font-size: 40px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
.mtcam-about-logo-title { font-size: 21px; font-weight: 700; color: #fff; }
.mtcam-about-logo-sub { font-size: 12px; color: rgba(255,255,255,0.68); margin-top: 3px; }
.mtcam-about-version-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 10px;
    padding: 10px 20px;
    text-align: center;
}
.mtcam-about-vbadge-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.55); }
.mtcam-about-vbadge-number { font-size: 20px; font-weight: 700; color: #fff; line-height: 1.2; }
.mtcam-about-vbadge-lic { font-size: 10px; color: rgba(255,255,255,0.5); margin-top: 2px; }

/* Stats */
.mtcam-about-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}
.mtcam-about-stat {
    border-radius: var(--mtcam-radius);
    padding: 14px 10px;
    text-align: center;
    border: 1px solid transparent;
    transition: transform var(--mtcam-transition), box-shadow var(--mtcam-transition);
}
.mtcam-about-stat:hover { transform: translateY(-2px); box-shadow: var(--mtcam-shadow-hover); }
.mtcam-about-stat-icon  { font-size: 22px; margin-bottom: 5px; }
.mtcam-about-stat-value { font-size: 20px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.mtcam-about-stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; opacity: 0.75; }
.mtcam-about-stat-blue   { background: #e3f2fd; border-color: #90caf9; color: #1565c0; }
.mtcam-about-stat-green  { background: #e8f5e9; border-color: #a5d6a7; color: #2e7d32; }
.mtcam-about-stat-red    { background: #ffebee; border-color: #ef9a9a; color: #c62828; }
.mtcam-about-stat-orange { background: #fff3e0; border-color: #ffcc80; color: #e65100; }
.mtcam-about-stat-purple { background: #f3e5f5; border-color: #ce93d8; color: #6a1b9a; }
.mtcam-about-stat-teal   { background: #e0f2f1; border-color: #80cbc4; color: #00695c; }

/* Bottom grid — 3 cols */
.mtcam-about-bottom-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
    align-items: start;
}

/* Cards */
.mtcam-about-card {
    background: #fff;
    border: 1px solid var(--mtcam-border-light);
    border-radius: var(--mtcam-radius);
    padding: 20px 22px;
    box-shadow: var(--mtcam-shadow);
}
.mtcam-about-card-title {
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--mtcam-text);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--mtcam-border-light);
}

/* Action list */
.mtcam-about-action-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 782px) { .mtcam-about-action-list { grid-template-columns: 1fr; } }
.mtcam-about-action-group { padding: 10px; background: var(--mtcam-bg); border-radius: var(--mtcam-radius); }
.mtcam-about-action-group-title { font-size: 12px; font-weight: 700; color: var(--mtcam-text); margin-bottom: 5px; }
.mtcam-about-action-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: var(--mtcam-text-muted);
    line-height: 1.5;
    margin-bottom: 3px;
}
.mtcam-about-action-item code { font-size: 11px; background: var(--mtcam-bg); padding: 1px 5px; border-radius: 3px; color: var(--mtcam-text); }
.mtcam-about-action-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.mtcam-about-dot-blue   { background: #2271b1; }
.mtcam-about-dot-green  { background: #4CAF50; }
.mtcam-about-dot-red    { background: #d63638; }
.mtcam-about-dot-purple { background: #9C27B0; }
.mtcam-about-dot-teal   { background: #009688; }

/* Quick links */
.mtcam-about-links-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.mtcam-about-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--mtcam-radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all var(--mtcam-transition);
}
.mtcam-about-link:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,0.1); text-decoration: none; }
.mtcam-about-link-blue   { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.mtcam-about-link-yellow { background: #fffde7; color: #f57f17; border-color: #fff176; }
.mtcam-about-link-green  { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.mtcam-about-link-purple { background: #f3e5f5; color: #6a1b9a; border-color: #ce93d8; }
.mtcam-about-link-teal   { background: #e0f2f1; color: #00695c; border-color: #80cbc4; }
.mtcam-about-link-orange { background: #fff3e0; color: #e65100; border-color: #ffcc80; }
.mtcam-about-link-donate { background: #fff8e1; color: #f57f17; border-color: #ffe082; font-weight: 600; }
.mtcam-about-link-donate:hover { background: #ffecb3; color: #e65100; }

/* Requirements */
.mtcam-about-req-list { display: flex; flex-direction: column; gap: 6px; }
.mtcam-about-req-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; background: var(--mtcam-bg); border-radius: var(--mtcam-radius-sm); padding: 8px 12px; font-size: 12px; }
.mtcam-about-req-name  { font-weight: 600; color: var(--mtcam-text); }
.mtcam-about-req-need  { color: var(--mtcam-text-muted); }
.mtcam-about-req-have  { font-family: monospace; font-size: 11px; font-weight: 700; }
.mtcam-about-req-ok    { color: var(--mtcam-success); }
.mtcam-about-req-warn  { color: var(--mtcam-danger); }

/* Responsive */
@media (max-width: 1100px) {
    .mtcam-about-stats-grid { grid-template-columns: repeat(3, 1fr); }
    .mtcam-about-bottom-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
    .mtcam-about-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .mtcam-about-bottom-grid { grid-template-columns: 1fr; }
    .mtcam-about-hero-inner { flex-direction: column; align-items: flex-start; }
}

