/**
 * UFW Firewall Manager - Custom Styles
 */

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

/* Navbar */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    border-radius: 8px;
}

.card-header {
    border-bottom: none;
    border-radius: 8px 8px 0 0 !important;
}

/* Table Improvements */
#rules-table {
    margin-bottom: 0;
}

#rules-table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#rules-table tbody tr {
    transition: background-color 0.2s ease;
}

#rules-table tbody tr:hover {
    background-color: #f1f3f5;
}

#rules-table code {
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.875rem;
}

/* Badges */
.badge {
    padding: 0.375rem 0.75rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* Form Inputs */
.form-control,
.form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Status Indicator */
#status-indicator {
    min-width: 200px;
}

#status-indicator .badge {
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

/* Loading States */
.spinner-border {
    vertical-align: middle;
}

/* Toast Notifications */
.toast {
    min-width: 300px;
}

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

/* Empty State */
#rules-empty i {
    opacity: 0.3;
}

/* Login Page Specific */
.login-card .card-body {
    padding: 2rem !important;
}

.login-card input {
    padding: 0.75rem;
}

.login-card .btn-lg {
    padding: 0.75rem;
    font-size: 1.1rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }

    #rules-table {
        font-size: 0.875rem;
    }

    #rules-table th,
    #rules-table td {
        padding: 0.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    #status-indicator {
        margin-top: 1rem;
    }
}

/* Utilities */
.text-bg-success {
    background-color: #198754 !important;
    color: white !important;
}

.text-bg-danger {
    background-color: #dc3545 !important;
    color: white !important;
}

.text-bg-warning {
    background-color: #ffc107 !important;
    color: black !important;
}

.text-bg-info {
    background-color: #0dcaf0 !important;
    color: black !important;
}

/* Animation for adding/removing rules */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#rules-tbody tr {
    animation: fadeIn 0.3s ease;
}
