/* BioLogin Admin Styles */

#biologin-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 20px 20px 0 0;
}

/* Reset WordPress admin styles for our app */
#biologin-app * {
    box-sizing: border-box;
}

/* Tailwind-like utilities */
.bl-container {
    max-width: 1200px;
}

.bl-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.bl-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
    margin: 0;
}

.bl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.bl-btn-primary {
    background: #2271b1;
    color: #fff;
}

.bl-btn-primary:hover {
    background: #135e96;
}

.bl-btn-danger {
    background: #d63638;
    color: #fff;
}

.bl-btn-danger:hover {
    background: #b32d2e;
}

.bl-btn-outline {
    background: #fff;
    color: #1d2327;
    border: 1px solid #c3c4c7;
}

.bl-btn-outline:hover {
    background: #f6f7f7;
}

/* Stats grid */
.bl-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.bl-stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.bl-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1d2327;
    margin: 4px 0;
}

.bl-stat-label {
    font-size: 13px;
    color: #646970;
    margin: 0;
}

.bl-stat-change {
    font-size: 12px;
    color: #00a32a;
    margin-top: 8px;
}

.bl-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bl-stat-icon.blue { background: #e7f5ff; color: #2271b1; }
.bl-stat-icon.green { background: #d8f3dc; color: #00a32a; }
.bl-stat-icon.purple { background: #f3e8ff; color: #8b5cf6; }
.bl-stat-icon.red { background: #fee2e2; color: #d63638; }

/* Table styles */
.bl-table {
    width: 100%;
    border-collapse: collapse;
}

.bl-table th,
.bl-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.bl-table th {
    background: #f9fafb;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

/* Status badges */
.bl-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}

.bl-badge-success { background: #d1fae5; color: #065f46; }
.bl-badge-warning { background: #fef3c7; color: #92400e; }
.bl-badge-danger { background: #fee2e2; color: #991b1b; }
.bl-badge-info { background: #dbeafe; color: #1e40af; }

/* Device cards */
.bl-device-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.bl-device-card:hover {
    border-color: #2271b1;
}

.bl-device-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bl-device-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.bl-device-icon.faceid { background: #f3e8ff; color: #8b5cf6; }
.bl-device-icon.touchid { background: #e7f5ff; color: #2271b1; }
.bl-device-icon.windows { background: #e0f2fe; color: #0284c7; }

.bl-device-name {
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 4px 0;
}

.bl-device-meta {
    font-size: 13px;
    color: #646970;
}

/* Toggle switches */
.bl-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.bl-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.bl-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #c3c4c7;
    border-radius: 24px;
    transition: 0.3s;
}

.bl-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.bl-toggle input:checked + .bl-toggle-slider {
    background-color: #2271b1;
}

.bl-toggle input:checked + .bl-toggle-slider:before {
    transform: translateX(20px);
}

/* Settings section */
.bl-settings-section {
    margin-bottom: 32px;
}

.bl-settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 16px;
}

.bl-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.bl-setting-row:hover {
    background: #f9fafb;
}

.bl-setting-label {
    font-weight: 500;
    color: #1d2327;
    margin: 0 0 4px 0;
}

.bl-setting-desc {
    font-size: 13px;
    color: #646970;
    margin: 0;
}

/* Alerts */
.bl-alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.bl-alert-warning {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.bl-alert-danger {
    background: #fee2e2;
    border-left: 4px solid #d63638;
}

.bl-alert-success {
    background: #d1fae5;
    border-left: 4px solid #00a32a;
}

/* Loading spinner */
.bl-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: bl-spin 0.8s linear infinite;
}

@keyframes bl-spin {
    to { transform: rotate(360deg); }
}

/* Modal */
.bl-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    backdrop-filter: blur(4px);
}

.bl-modal {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.bl-modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 36px;
}

.bl-modal-icon.blue { background: #dbeafe; color: #2271b1; }
.bl-modal-icon.green { background: #d1fae5; color: #00a32a; }

.bl-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 8px 0;
}

.bl-modal-text {
    font-size: 14px;
    color: #646970;
    margin: 0;
}

/* Chart container */
.bl-chart-container {
    height: 300px;
    margin-top: 16px;
}

/* Search input */
.bl-search {
    position: relative;
}

.bl-search input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.bl-search input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

.bl-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #646970;
}

/* Lockdown banner */
.bl-lockdown-banner {
    background: #d63638;
    color: #fff;
    padding: 24px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    animation: bl-pulse 2s infinite;
}

@keyframes bl-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.bl-lockdown-banner h2 {
    margin: 0 0 8px 0;
    font-size: 20px;
}

.bl-lockdown-banner p {
    margin: 0;
    opacity: 0.9;
}

/* Risk indicators */
.bl-risk-high {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    animation: bl-pulse 1.5s infinite;
}

.bl-risk-medium {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

/* Country tags */
.bl-country-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    margin: 4px;
}

.bl-country-tag.allow { background: #d1fae5; color: #065f46; }
.bl-country-tag.block { background: #fee2e2; color: #991b1b; }

.bl-country-tag button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.bl-country-tag button:hover {
    opacity: 1;
}

/* Select dropdown */
.bl-select {
    padding: 10px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    min-width: 150px;
}

.bl-select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

/* Toast notification */
.bl-toast {
    position: fixed;
    top: 50px;
    right: 20px;
    background: #1d2327;
    color: #fff;
    padding: 16px 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 100001;
    animation: bl-slide-in 0.3s ease-out;
}

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

.bl-toast-icon {
    color: #00a32a;
}

.bl-toast-title {
    font-weight: 600;
    margin: 0 0 2px 0;
}

.bl-toast-message {
    font-size: 13px;
    opacity: 0.8;
    margin: 0;
}

/* Responsive */
@media (max-width: 782px) {
    #biologin-app {
        margin: 10px;
    }
    
    .bl-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .bl-device-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .bl-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
