/* auth-logs.css - Styling for authentication logs viewer */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header h1 {
    margin: 0;
    color: #333;
}

/* Charts Section */
.charts-section {
    margin-bottom: 3rem;
}

.charts-section h2 {
    color: #333;
    margin-bottom: 1rem;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chart-card h3 {
    margin: 0 0 1rem 0;
    color: #555;
    font-size: 1.1rem;
}

.chart-card canvas {
    max-height: 250px;
    margin-bottom: 1rem;
}

.chart-stats {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2196F3;
}

.stat.failure .stat-value {
    color: #f44336;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 2rem;
}

.tab {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab:hover {
    color: #333;
    background: #f5f5f5;
}

.tab.active {
    color: #2196F3;
    border-bottom-color: #2196F3;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filters input,
.filters select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

.filters input {
    flex: 1;
    min-width: 200px;
}

.filters select {
    min-width: 120px;
}

/* Table */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
}

.log-table thead {
    background: #f5f5f5;
}

.log-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
}

.log-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.log-table tbody tr:hover {
    background: #fafafa;
}

.log-table .loading {
    text-align: center;
    color: #999;
    padding: 2rem;
}

.log-table .no-data {
    text-align: center;
    color: #999;
    padding: 2rem;
}

.timestamp {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #666;
}

.username {
    font-weight: 500;
    color: #2196F3;
}

.ip-address {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.failure-reason {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    display: inline-block;
}

.failure-reason.user-not-found {
    background: #ffebee;
    color: #c62828;
}

.failure-reason.invalid-password {
    background: #fff3e0;
    color: #e65100;
}

.failure-reason.account-locked {
    background: #fce4ec;
    color: #880e4f;
}

.token-age {
    font-size: 0.9rem;
    color: #666;
}

.user-agent {
    font-size: 0.85rem;
    color: #999;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    background: #2196F3;
    color: white;
}

.btn:hover {
    background: #1976D2;
}

.btn-secondary {
    background: #757575;
    color: white;
}

.btn-secondary:hover {
    background: #616161;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .filters {
        flex-direction: column;
    }

    .filters input,
    .filters select {
        width: 100%;
    }

    .log-table {
        font-size: 0.85rem;
    }

    .log-table th,
    .log-table td {
        padding: 0.5rem;
    }

    .user-agent {
        max-width: 150px;
    }
}
