/* nginx-defender Dashboard Styles */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* Status Cards */
.card.bg-primary,
.card.bg-danger,
.card.bg-warning,
.card.bg-success {
    background: linear-gradient(135deg, var(--primary-color), #0056b3) !important;
}

.card.bg-danger {
    background: linear-gradient(135deg, var(--danger-color), #c82333) !important;
}

.card.bg-warning {
    background: linear-gradient(135deg, var(--warning-color), #e0a800) !important;
}

.card.bg-success {
    background: linear-gradient(135deg, var(--success-color), #1e7e34) !important;
}

/* Progress Circles */
.progress-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--primary-color) 0%, var(--primary-color) 0%, #e9ecef 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.progress-circle span {
    position: absolute;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dark-color);
}

.progress-circle::before {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: white;
}

/* Threat Feed */
.threat-feed {
    height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 10px;
    background-color: #f8f9fa;
}

.threat-item {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-left: 4px solid;
    background-color: white;
    border-radius: 4px;
    animation: slideIn 0.3s ease-out;
}

.threat-item.high {
    border-left-color: var(--danger-color);
}

.threat-item.medium {
    border-left-color: var(--warning-color);
}

.threat-item.low {
    border-left-color: var(--info-color);
}

.threat-item.critical {
    border-left-color: #6f42c1;
    background-color: #f8f5ff;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: var(--dark-color);
}

.table-sm th,
.table-sm td {
    padding: 0.5rem;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-online {
    background-color: #d1edff;
    color: #0c63e4;
}

.status-blocked {
    background-color: #f8d7da;
    color: #721c24;
}

.status-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* Charts */
canvas {
    max-height: 400px;
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Country Flags */
.country-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    margin-right: 5px;
}

/* Loading Animations */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.6),
        transparent
    );
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .card-body h4 {
        font-size: 1.5rem;
    }
    
    .progress-circle {
        width: 100px;
        height: 100px;
    }
    
    .progress-circle span {
        font-size: 1.2rem;
    }
    
    .progress-circle::before {
        width: 75px;
        height: 75px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --dark-color: #f8f9fa;
        --light-color: #343a40;
    }
    
    body {
        background-color: #1a1a1a;
        color: #f8f9fa;
    }
    
    .card {
        background-color: #2d2d2d;
        color: #f8f9fa;
    }
    
    .card-header {
        background-color: rgba(255, 255, 255, 0.05);
        border-bottom-color: rgba(255, 255, 255, 0.125);
    }
    
    .threat-feed {
        background-color: #2d2d2d;
        border-color: #495057;
    }
    
    .threat-item {
        background-color: #3d3d3d;
        color: #f8f9fa;
    }
}

/* Custom Scrollbar */
.threat-feed::-webkit-scrollbar {
    width: 6px;
}

.threat-feed::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.threat-feed::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.threat-feed::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

/* Map Styles */
#world-map {
    border-radius: 8px;
    overflow: hidden;
}

/* Modal Enhancements */
.modal-content {
    border: none;
    border-radius: 10px;
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.125);
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    min-width: 300px;
    padding: 15px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    animation: slideInRight 0.3s ease-out;
}

.notification.success {
    background-color: var(--success-color);
}

.notification.error {
    background-color: var(--danger-color);
}

.notification.warning {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.notification.info {
    background-color: var(--info-color);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Utility Classes */
.text-shadow {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.border-radius-lg {
    border-radius: 0.5rem !important;
}

.box-shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.box-shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}
