/* Track 404s Admin Styles */

.track-404s-wrap {
    max-width: 1400px;
    margin: 20px 0;
}

/* Header */
.track-404s-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.header-left {
    flex: 1;
}

.track-404s-header h1 {
    font-size: 23px;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    font-weight: 400;
}

.switchboard-badge {
    font-size: 11px;
    padding: 4px 10px;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.subtitle {
    margin: 0;
    padding-left: 0px;
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 400;
}

.header-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-input {
    padding: 0 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    width: 250px;
    font-size: 13px;
    height: 32px;
    transition: border-color 0.15s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(var(--primary-500-rgb), 0.1);
}

.header-right .button {
    background: var(--primary-500);
    color: white;
    border: none;
    padding: 0 16px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 13px;
    transition: background-color 0.15s ease;
    cursor: pointer;
    height: 32px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header-right .button:hover {
    background: var(--primary-600);
}

.header-right .button-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.header-right .button-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

/* Two Column Dashboard Layout */
.dashboard-two-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dashboard-card h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

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

.dashboard-table th {
    background: var(--gray-50);
    font-weight: 600;
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 12px;
    text-align: left;
}

.dashboard-table td {
    padding: 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

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

.dashboard-table tbody tr:last-child td {
    border-bottom: none;
}

.dashboard-table .url-col {
    font-family: 'Monaco', 'Menlo', monospace;
    color: #ef4444;
    font-size: 12px;
    word-break: break-word;
    max-width: 300px;
}

.dashboard-table .hits-col {
    font-weight: 600;
    color: var(--gray-900);
}

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

@media (max-width: 1024px) {
    .dashboard-two-col {
        grid-template-columns: 1fr;
    }
}

/* Table Container */
.track-404s-table-container {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#track-404s-table {
    margin: 0;
    border: none;
    width: 100%;
}

#track-404s-table th {
    background: var(--gray-50);
    font-weight: 500;
    padding: 14px 12px;
    border-bottom: 2px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

#track-404s-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

#track-404s-table th.sortable:hover {
    background: var(--gray-100);
}

#track-404s-table th.sortable.active {
    color: var(--primary-500);
}

.sort-indicator {
    margin-left: 5px;
    opacity: 0.3;
}

.sort-indicator::after {
    content: '↕';
}

th.sortable.active .sort-indicator {
    opacity: 1;
}

th.sortable.asc .sort-indicator::after {
    content: '↑';
}

th.sortable.desc .sort-indicator::after {
    content: '↓';
}

#track-404s-table td {
    padding: 16px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

#track-404s-table tbody tr {
    transition: background-color 0.15s ease;
}

#track-404s-table tbody tr:hover {
    background-color: var(--gray-50);
}

#track-404s-table tbody tr:last-child td {
    border-bottom: none;
}

.url-cell {
    font-family: 'Monaco', 'Menlo', monospace;
    color: #e74c3c;
    word-break: break-word;
}

.hit-count {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.date-cell {
    color: #666;
    font-size: 12px;
}

.referrer-cell {
    color: var(--primary-500);
    font-size: 12px;
    word-break: break-word;
}

.referrer-cell a {
    color: var(--primary-500);
    text-decoration: none;
    transition: color 0.15s ease;
}

.referrer-cell a:hover {
    color: var(--primary-600);
}

.no-referrer {
    color: #999;
    font-style: italic;
}

.action-delete {
    color: #ef4444;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.action-delete:hover {
    color: #dc2626;
    background: #fef2f2;
}

.loading-state {
    text-align: center;
    padding: 40px !important;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Pagination */
.track-404s-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.track-404s-pagination .button {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    padding: 0 16px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 13px;
    transition: background-color 0.15s ease;
    cursor: pointer;
    height: 32px;
    line-height: 1;
}

.track-404s-pagination .button:not(:disabled):hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.track-404s-pagination .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#track-404s-page-info {
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .track-404s-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-right {
        width: 100%;
        flex-direction: column;
    }

    .search-input {
        width: 100%;
    }

    .track-404s-stats {
        grid-template-columns: 1fr;
    }

    .track-404s-table-container {
        overflow-x: auto;
    }
}
