/* Custom CSS for Sanctions Management System */

/* General Styles */
body {
    background-color: #f8f9fa;
}

/* Navbar */
.navbar-brand {
    font-weight: bold;
}

/* Sidebar */
.sanctions-list-toggle {
    text-decoration: none !important;
    color: #333 !important;
    transition: all 0.3s ease;
}

.sanctions-list-toggle:hover {
    background-color: #e9ecef !important;
    color: #495057 !important;
}

.list-type-btn {
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.list-type-btn:hover {
    transform: translateX(5px);
}

.list-type-btn.active {
    background-color: var(--bs-primary);
    color: white !important;
    border-color: var(--bs-primary);
}

/* Cards */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-header {
    font-weight: 600;
}

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

.table th {
    border-top: none;
    font-weight: 600;
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table td {
    vertical-align: middle;
    word-break: break-word;
    max-width: 200px;
}

.table td[title] {
    cursor: help;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.075);
}

/* Pagination */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: #495057;
    border-color: #dee2e6;
}

.page-link:hover {
    color: #0056b3;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

/* Modal */
.modal-content {
    border-radius: 0.5rem;
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
}

/* Modal body text wrapping */
.modal-body {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.modal-body .border.rounded {
    word-break: break-all;
    white-space: pre-wrap;
}

.modal-body pre {
    white-space: pre-wrap;
    word-break: break-word;
}

.modal-body .text-muted span {
    word-break: break-word;
}

/* URL and long text handling */
.modal-body a,
.modal-body .url-text {
    word-break: break-all;
    text-decoration: underline;
    color: #0d6efd;
}

/* Ensure content doesn't overflow container */
.modal-body * {
    max-width: 100%;
    box-sizing: border-box;
}

/* Scan results styling */
.scan-result-row {
    transition: background-color 0.2s ease;
}

.scan-result-row:hover {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

.scan-result-row[title] {
    cursor: pointer;
}

/* Risk level badges */
.badge.bg-danger {
    animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Search Input */
#search-input {
    border-radius: 0.375rem;
}

/* Badge */
.badge {
    font-size: 0.875rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .col-md-3 {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-sm {
        font-size: 0.75rem;
    }
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 1rem;
}

/* Form Controls */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-outline-primary:hover,
.btn-outline-danger:hover,
.btn-outline-warning:hover,
.btn-outline-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

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

/* Utility Classes */
.text-truncate-50 {
    max-width: 50ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cursor-pointer {
    cursor: pointer;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e9ecef;
    }
    
    .card {
        background-color: #2d2d2d;
        border-color: #404040;
    }
    
    .table {
        color: #e9ecef;
    }
    
    .table th {
        background-color: #343a40;
        border-color: #404040;
    }
    
    .modal-content {
        background-color: #2d2d2d;
        color: #e9ecef;
    }
}
