/* PDI UR Reporting System Styles */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

/* Card headers are styled in page-specific CSS */
/* .card-header styling moved to individual pages */

.card-title {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 0;
}

.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, var(--primary-color) 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #1e7e34 100%);
    border: none;
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #117a8b 100%);
    border: none;
}

.table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, var(--dark-color) 0%, #495057 100%);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.form-control, .form-select {
    border-radius: 6px;
}

/* AI Estimation Logs Styling */
.log-entry {
    background: white;
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    transition: all 0.2s ease;
}

.log-entry:hover {
    border-color: #007bff !important;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.log-entry .badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

.log-entry pre {
    font-size: 0.8rem;
    max-height: 200px;
    overflow-y: auto;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

.log-entry .collapse {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.log-entry .text-success.fw-bold {
    font-size: 1.1rem;
}

.log-entry .small {
    line-height: 1.4;
}

.log-entry details summary {
    cursor: pointer;
    user-select: none;
}

.log-entry details summary:hover {
    color: var(--primary-color);
    transition: color 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.alert {
    border: none;
    border-radius: 8px;
    border-left: 4px solid;
}

/* Fixed overlay alerts */
.alert-overlay {
    position: fixed;
    top: 70px; /* Position below the navbar */
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    min-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
    opacity: 0.95;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-info {
    border-left-color: var(--info-color);
}

.alert-success {
    border-left-color: var(--success-color);
}

.alert-warning {
    border-left-color: var(--warning-color);
}

.alert-danger {
    border-left-color: var(--danger-color);
}

.jumbotron {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    border-radius: 10px;
}

.spinner-border {
    color: var(--primary-color);
}

/* DataTables customization */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 4px;
    margin: 0 2px;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-connected {
    background-color: var(--success-color);
}

.status-disconnected {
    background-color: var(--danger-color);
}

.status-warning {
    background-color: var(--warning-color);
}

/* Footer */
footer {
    margin-top: auto;
}

/* Filter controls styling */
.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Utility classes */
.text-truncate {
    max-width: 200px;
}

.cursor-pointer {
    cursor: pointer;
}

.border-left-primary {
    border-left: 4px solid var(--primary-color) !important;
}

.border-left-success {
    border-left: 4px solid var(--success-color) !important;
}

.border-left-info {
    border-left: 4px solid var(--info-color) !important;
}

.border-left-warning {
    border-left: 4px solid var(--warning-color) !important;
}

.border-left-danger {
    border-left: 4px solid var(--danger-color) !important;
}