/* public/css/style.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0f172a;
    color: #e2e8f0;
    font-family: Arial, sans-serif;
}

a {
    text-decoration: none;
}

.container {
    width: 95%;
    max-width: 1400px;
    margin: auto;
}

.navbar {
    background: #111827;
    border-bottom: 1px solid #1e293b;
    padding: 20px 0;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: #38bdf8;
    font-size: 24px;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: #cbd5e1;
}

.card {
    background: #111827;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
}

.subtitle {
    margin-top: 10px;
    color: #94a3b8;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stats-card {
    background: #111827;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 30px;
}

.stats-card h3 {
    color: #94a3b8;
    font-size: 16px;
}

.stats-card p {
    font-size: 40px;
    margin-top: 15px;
    font-weight: bold;
    color: #38bdf8;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.analytics-card {
    min-height: 250px;
}

.analytics-card h3 {
    margin-bottom: 20px;
}

.analytics-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.analytics-item {
    display: flex;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid #1e293b;
}

.analytics-item span:last-child {
    color: #38bdf8;
    font-weight: bold;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.dashboard-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-form input {
    padding: 12px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    color: white;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.info-item {
    background: #0f172a;
    border-radius: 10px;
    padding: 20px;
}

.label {
    display: block;
    color: #94a3b8;
    margin-bottom: 10px;
    font-size: 14px;
}

.value {
    color: #f8fafc;
    word-break: break-word;
}

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

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 450px;
}

.form-group {
    margin-top: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
}

.form-group input {
    width: 100%;
    padding: 14px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    color: white;
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    background: #38bdf8;
    color: #0f172a;
    font-weight: bold;
    cursor: pointer;
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 30px;
}

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

th,
td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #1e293b;
}

th {
    color: #38bdf8;
}

tr {
    transition: 0.2s ease;
}

tr:hover {
    background: #0f172a;
}

.visitor-row {
    cursor: pointer;
}

.ip-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.copy-btn {
    padding: 6px 10px;
    font-size: 12px;
    min-width: 70px;
}

.copy-btn:hover {
    opacity: 0.9;
}

.export-btn {
    padding: 12px 20px;
    border-radius: 10px;
    background: #22c55e;
    color: #0f172a;
    font-weight: bold;
    transition: 0.2s ease;
}

.export-btn:hover {
    opacity: 0.9;
}

.pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.pagination a {
    padding: 10px 16px;
    background: #38bdf8;
    border-radius: 10px;
    color: #0f172a;
    font-weight: bold;
    transition: 0.2s ease;
}

.pagination a:hover {
    opacity: 0.9;
}

.visited-at {
    white-space: nowrap;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 900px;
    background: #111827;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 30px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: auto;
    padding: 8px 14px;
    font-size: 18px;
}

.modal-body {
    margin-top: 25px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.modal-section {
    background: #0f172a;
    border-radius: 12px;
    padding: 20px;
}

.modal-section h3 {
    margin-bottom: 20px;
    color: #38bdf8;
}

.modal-item {
    margin-bottom: 14px;
    word-break: break-word;
}

.error-box {
    margin-top: 20px;
    padding: 14px;
    border-radius: 10px;
    background: #7f1d1d;
    color: #fecaca;
    border: 1px solid #991b1b;
}

.danger-btn {
    padding: 12px 20px;
    border-radius: 10px;
    background: #dc2626;
    color: white;
    font-weight: bold;
}

.delete-btn {
    padding: 8px 12px;
    border-radius: 8px;
    background: #dc2626;
    color: white;
    font-size: 12px;
}

.risk-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
}

.risk-low {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.risk-medium {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.risk-high {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.risk-critical {
    background: rgba(220, 38, 38, 0.2);
    color: #dc2626;
}

.row-medium {
    background: rgba(234, 179, 8, 0.04);
}

.row-high {
    background: rgba(249, 115, 22, 0.05);
}

.row-critical {
    background: rgba(220, 38, 38, 0.06);
}

.country-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.flag {
    font-size: 18px;
}

.risk-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.risk-score {
    color: #94a3b8;
    font-size: 13px;
}

.risk-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag {
    background: #1e293b;
    border: 1px solid #334155;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    color: #cbd5e1;
}

.client-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.client-info small {
    color: #64748b;
}

.isp-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.isp-info small {
    color: #64748b;
}

.visit-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 28px;
    border-radius: 999px;
    background: #0f172a;
    border: 1px solid #334155;
}

.refresh-btn {
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid #334155;
}

.empty-state {
    color: #64748b;
    padding: 20px 0;
}

.success-badge {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
}

.failed-badge {
    background: rgba(220, 38, 38, 0.2);
    color: #dc2626;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
}

@media (max-width: 768px) {

    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-actions {
        width: 100%;
        flex-direction: column;
    }

    .search-form {
        width: 100%;
    }

    .search-form input {
        width: 100%;
    }

    .pagination {
        flex-wrap: wrap;
    }

    table {
        min-width: 900px;
    }

}


.useragent-cell {
    max-width: 350px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delete-login-log-btn {
    padding: 8px 12px;
    border-radius: 8px;
    background: #dc2626;
    color: white;
    font-size: 12px;
}

.delete-login-log-btn:hover {
    opacity: 0.9;
}