/* Custom Styles for Autopilot Web UI */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
}

body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.nav-link {
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
}

.nav-link.active {
    font-weight: 600;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s ease;
}

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

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #f8f9fa;
    font-weight: 600;
}

/* Settings Sidebar */
.list-group-item {
    border: none;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background-color: #f8f9fa;
    transform: translateX(4px);
}

.list-group-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.list-group {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.375rem;
    padding: 0.5rem;
    background-color: white;
}

/* 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 {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-card .card-body {
    padding: 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 3rem;
    color: var(--primary-color);
}

.login-header h1 {
    margin-top: 1rem;
    font-size: 1.75rem;
    font-weight: 600;
}

/* Alerts */
.alert-badge {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.alert-badge.triggered {
    background-color: #dc3545;
    color: white;
}

.alert-badge.acknowledged {
    background-color: #ffc107;
    color: #000;
}

.alert-badge.resolved {
    background-color: #198754;
    color: white;
}

.priority-low {
    color: #6c757d;
}

.priority-normal {
    color: #0d6efd;
}

.priority-high {
    color: #fd7e14;
}

.priority-critical {
    color: #dc3545;
    font-weight: 600;
}

/* Stats Cards */
.stat-card {
    padding: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.stat-card.success {
    border-left-color: var(--success-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.danger {
    border-left-color: var(--danger-color);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Tables */
.table-hover tbody tr {
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
}

/* Buttons */
.btn {
    transition: all 0.3s ease;
}

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

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    margin-bottom: 0.5rem;
}

/* Logs */
.log-entry {
    padding: 0.75rem;
    border-left: 3px solid #dee2e6;
    margin-bottom: 0.5rem;
    background-color: #fff;
    border-radius: 0.25rem;
}

.log-entry.debug {
    border-left-color: #6c757d;
}

.log-entry.info {
    border-left-color: #0dcaf0;
}

.log-entry.warning {
    border-left-color: #ffc107;
}

.log-entry.error {
    border-left-color: #dc3545;
}

.log-entry.critical {
    border-left-color: #dc3545;
    background-color: #fff5f5;
}

.log-timestamp {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-value {
        font-size: 1.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

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

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

/* Utility Classes */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal Enhancements */
.modal-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.modal-header.bg-danger {
    background-color: var(--danger-color) !important;
    border-bottom: 2px solid rgba(220, 53, 69, 0.8);
}

.modal-content {
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

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

/* Table Enhancements */
.table-responsive {
    border-radius: 0.375rem;
}

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

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Action Buttons */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    transition: all 0.2s ease;
}

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

/* Form Required Indicator */
.form-label .text-danger {
    font-size: 0.875rem;
}

/* Badge Enhancements */
.badge {
    font-size: 0.875rem;
    padding: 0.35rem 0.65rem;
    font-weight: 500;
}

/* Modal Form Sections */
.modal-body h6 {
    color: #495057;
    font-weight: 600;
    margin-top: 1rem;
}

.modal-body h6:first-child {
    margin-top: 0;
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }

    .btn-group {
        display: flex;
        flex-direction: column;
    }

    .btn-group .btn {
        margin-bottom: 0.25rem;
        border-radius: 0.25rem !important;
    }

    .modal-dialog-scrollable .modal-body {
        max-height: calc(100vh - 200px);
    }
}
