/**
 * Hide My Login - Admin Page Styles
 * Matches Switchboard design system
 */

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
    --hml-primary: #6366f1;
    --hml-primary-hover: #4f46e5;
    --hml-success: #16a34a;
    --hml-danger: #dc2626;
    --hml-warning: #d97706;
    --hml-gray-50: #f9fafb;
    --hml-gray-100: #f3f4f6;
    --hml-gray-200: #e5e7eb;
    --hml-gray-300: #d1d5db;
    --hml-gray-400: #9ca3af;
    --hml-gray-500: #6b7280;
    --hml-gray-600: #4b5563;
    --hml-gray-700: #374151;
    --hml-gray-800: #1f2937;
    --hml-gray-900: #111827;
}

/* ==========================================================================
   Stats Cards
   ========================================================================== */
.sb-stat-danger {
    color: var(--hml-danger) !important;
}

.sb-stat-success {
    color: var(--hml-success) !important;
}

/* ==========================================================================
   Filters
   ========================================================================== */
.hml-filters-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hml-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: var(--hml-primary);
    border-radius: 10px;
    margin-left: 8px;
}

.hml-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--hml-gray-300);
    border-radius: 6px;
    background: #fff;
    color: var(--hml-gray-700);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hml-select:focus {
    outline: none;
    border-color: var(--hml-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.hml-select-sm {
    padding: 4px 8px;
    font-size: 13px;
}

.hml-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--hml-gray-300);
    border-radius: 6px;
    background: #fff;
    color: var(--hml-gray-700);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hml-input:focus {
    outline: none;
    border-color: var(--hml-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.hml-custom-dates {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    background: var(--hml-gray-50);
    border-radius: 6px;
    margin-top: -8px;
}

/* ==========================================================================
   Action Buttons
   ========================================================================== */
.hml-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--hml-gray-700);
    background: #fff;
    border: 1px solid var(--hml-gray-300);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.hml-action-btn:hover {
    background: var(--hml-gray-50);
    border-color: var(--hml-gray-400);
}

.hml-action-btn-primary {
    color: #fff;
    background: var(--hml-primary);
    border-color: var(--hml-primary);
}

.hml-action-btn-primary:hover {
    background: var(--hml-primary-hover);
    border-color: var(--hml-primary-hover);
}

.hml-action-btn-danger {
    color: #fff;
    background: var(--hml-danger);
    border-color: var(--hml-danger);
}

.hml-action-btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

/* ==========================================================================
   Table
   ========================================================================== */
.hml-table {
    width: 100%;
    border-collapse: collapse;
}

.hml-table thead th {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hml-gray-500);
    background: var(--hml-gray-50);
    border-bottom: 1px solid var(--hml-gray-200);
    text-align: left;
}

.hml-table tbody td {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--hml-gray-700);
    border-bottom: 1px solid var(--hml-gray-100);
    vertical-align: middle;
}

.hml-table tbody tr:hover {
    background: var(--hml-gray-50);
}

.hml-table tbody tr.selected {
    background: rgba(99, 102, 241, 0.05);
}

.hml-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ==========================================================================
   Badges & Status
   ========================================================================== */
.hml-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 9999px;
}

.hml-badge-success {
    color: var(--hml-success);
    background: #f0fdf4;
}

.hml-badge-danger {
    color: var(--hml-danger);
    background: #fef2f2;
}

.hml-badge-warning {
    color: var(--hml-warning);
    background: #fffbeb;
}

.hml-badge-gray {
    color: var(--hml-gray-600);
    background: var(--hml-gray-100);
}

.hml-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    background: var(--hml-gray-100);
    color: var(--hml-gray-600);
}

/* ==========================================================================
   Per Page & Bulk Actions
   ========================================================================== */
.hml-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--hml-gray-500);
}

.hml-bulk-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 16px;
    padding-right: 16px;
    border-right: 1px solid var(--hml-gray-200);
}

.hml-selected-count {
    font-size: 14px;
    color: var(--hml-gray-600);
    font-weight: 500;
}

/* ==========================================================================
   IP Address & Details
   ========================================================================== */
.hml-ip-address {
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas, monospace;
    font-size: 13px;
    color: var(--hml-gray-700);
}

.hml-details-cell {
    max-width: 300px;
}

.hml-request-uri {
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--hml-gray-600);
    background: var(--hml-gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hml-view-details-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--hml-gray-400);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.hml-view-details-btn:hover {
    background: var(--hml-gray-100);
    color: var(--hml-gray-600);
}

/* ==========================================================================
   Top IPs List
   ========================================================================== */
.hml-top-ips-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hml-top-ip-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--hml-gray-100);
}

.hml-top-ip-item:last-child {
    border-bottom: none;
}

.hml-top-ip-address {
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas, monospace;
    font-size: 13px;
    color: var(--hml-gray-700);
}

.hml-top-ip-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--hml-danger);
    background: #fef2f2;
    padding: 2px 8px;
    border-radius: 9999px;
}

.hml-no-data {
    text-align: center;
    color: var(--hml-gray-400);
    font-size: 13px;
    padding: 16px 0;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.hml-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hml-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.hml-modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.hml-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hml-gray-200);
}

.hml-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--hml-gray-800);
}

.hml-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 24px;
    color: var(--hml-gray-400);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.hml-modal-close:hover {
    background: var(--hml-gray-100);
    color: var(--hml-gray-600);
}

.hml-modal-body {
    padding: 20px;
}

.hml-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--hml-gray-200);
    background: var(--hml-gray-50);
}

.hml-detail-row {
    margin-bottom: 16px;
}

.hml-detail-row:last-child {
    margin-bottom: 0;
}

.hml-detail-row label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hml-gray-500);
    margin-bottom: 6px;
}

.hml-detail-row code {
    display: block;
    padding: 8px 12px;
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas, monospace;
    font-size: 13px;
    background: var(--hml-gray-100);
    border-radius: 6px;
    word-break: break-all;
}

.hml-user-agent-text {
    margin: 0;
    padding: 12px;
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas, monospace;
    font-size: 12px;
    background: var(--hml-gray-100);
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
}

/* ==========================================================================
   Loading State
   ========================================================================== */
.hml-loading {
    text-align: center;
    color: var(--hml-gray-400);
    font-size: 13px;
    padding: 20px 0;
}

/* ==========================================================================
   Empty State
   ========================================================================== */
.hml-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.hml-empty-icon {
    font-size: 48px;
    color: var(--hml-gray-300);
    margin-bottom: 16px;
}

.hml-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--hml-gray-600);
    margin: 0 0 8px 0;
}

.hml-empty-desc {
    font-size: 14px;
    color: var(--hml-gray-400);
    margin: 0;
}

/* ==========================================================================
   Date/Time Formatting
   ========================================================================== */
.hml-datetime {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hml-date {
    font-size: 14px;
    font-weight: 500;
    color: var(--hml-gray-700);
}

.hml-time {
    font-size: 12px;
    color: var(--hml-gray-500);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1200px) {
    .sb-module-layout {
        flex-direction: column;
    }

    .sb-module-sidebar {
        width: 100%;
        max-width: none;
    }

    .sb-module-main {
        width: 100%;
    }
}
