/* Custom styles for PRE System */

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

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

/* Cards */
.card {
    border: none;
    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);
}

/* Tables */
.table {
    background-color: white;
}

.table-container {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
    margin-bottom: 2rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.numbers-table {
    width: 100%;
    margin-bottom: 0;
}

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

.table thead th {
    border-top: none;
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

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

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

/* Action buttons in tables */
.action-buttons {
    white-space: nowrap;
}

.action-buttons .btn {
    margin-right: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.action-buttons .btn i {
    font-size: 0.7rem;
}

.action-buttons .btn:last-child {
    margin-right: 0;
}

/* Compact button styles for tables and grids */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-sm i {
    font-size: 0.7rem;
}

/* Status badges */
.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Grid functionality */
.grid-container {
    background-color: white;
    border-radius: 0.375rem;
    padding: 1rem;
}

.grid-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.grid-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.grid-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Sortable columns */
.sortable-column {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.sortable-column:hover {
    background-color: #f8f9fa;
}

.sort-icon {
    margin-left: 0.5rem;
    opacity: 0.5;
}

.sort-icon.active {
    opacity: 1;
}

/* Filter dropdown */
.filter-dropdown {
    position: relative;
    display: inline-block;
}

.filter-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border: 1px solid #ddd;
    border-radius: 0.375rem;
    padding: 1rem;
    top: 100%;
    left: 0;
}

.filter-dropdown.show .filter-content {
    display: block;
}

/* Number formatting */
.number-field {
    text-align: right;
    font-family: 'Courier New', monospace;
}

/* Progress bars */
.progress-thin {
    height: 0.5rem;
}

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

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

/* Form improvements */
.form-label {
    font-weight: 500;
    color: #495057;
}

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

/* Alert improvements */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .grid-filters {
        flex-direction: column;
    }
    
    .grid-actions {
        flex-direction: column;
    }
    
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Tab improvements */
.nav-tabs .nav-link {
    color: #6c757d;
    border: 1px solid transparent;
}

.nav-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef #dee2e6;
    color: #495057;
}

.nav-tabs .nav-link.active {
    color: #495057;
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
}

/* Week/Month selector */
.period-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.period-selector .form-check {
    margin-bottom: 0;
}

/* Project status colors */
.status-on-track { color: #28a745; }
.status-at-risk { color: #ffc107; }
.status-danger { color: #dc3545; }
.status-completed { color: #6c757d; }
.status-on-hold { color: #17a2b8; }
.status-dropped { color: #6f42c1; }

/* Priority colors */
.priority-high { color: #dc3545; font-weight: 600; }
.priority-medium { color: #ffc107; font-weight: 500; }
.priority-low { color: #28a745; font-weight: 400; }

/* Corporate Blue Style - Applied globally */
.style-3 .page-header {
    background: #0d47a1;
    color: white;
    padding: 2rem;
    border-radius: 0;
    margin-bottom: 2rem;
    border-left: 5px solid #1976d2;
}
.style-3 .page-header h1 {
    color: white;
    font-weight: 600;
    margin: 0;
}
.style-3 .main-card {
    border: none;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.style-3 .card {
    border: none;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.style-3 .card-header {
    background: #f5f5f5;
    border-bottom: 3px solid #1976d2;
}
.style-3 .nav-tabs {
    border: none;
}
.style-3 .nav-tabs .nav-link {
    border: none;
    color: #424242;
    font-weight: 500;
    padding: 1rem 1.5rem;
    background: transparent;
}
.style-3 .nav-tabs .nav-link.active {
    color: #1976d2;
    background: white;
    border-top: 3px solid #1976d2;
}
.style-3 .form-label {
    font-weight: 600;
    color: #0d47a1;
}
.style-3 .form-control, .style-3 .form-select {
    border: 2px solid #e0e0e0;
    border-radius: 4px;
}
.style-3 .form-control:focus, .style-3 .form-select:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 0.2rem rgba(25, 118, 210, 0.25);
}
.style-3 .btn {
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}

.style-3 .btn i {
    font-size: 0.75rem;
}

.style-3 .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
}

.style-3 .btn-sm i {
    font-size: 0.65rem;
}

.style-3 .action-buttons .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
}

.style-3 .action-buttons .btn i {
    font-size: 0.65rem;
}
.style-3 .btn-primary {
    background: #1976d2;
    border: 2px solid #1976d2;
    color: white;
    box-shadow: 0 2px 10px rgba(25, 118, 210, 0.3);
}
.style-3 .btn-primary:hover {
    background: #0d47a1;
    border-color: #0d47a1;
    box-shadow: 0 4px 15px rgba(13, 71, 161, 0.4);
}
.style-3 .btn-success {
    background: #2e7d32;
    border: 2px solid #2e7d32;
    color: white;
    box-shadow: 0 2px 10px rgba(46, 125, 50, 0.3);
}
.style-3 .btn-success:hover {
    background: #1b5e20;
    border-color: #1b5e20;
    box-shadow: 0 4px 15px rgba(27, 94, 32, 0.4);
}
.style-3 .btn-secondary {
    background: #616161;
    border: 2px solid #616161;
    color: white;
    box-shadow: 0 2px 10px rgba(97, 97, 97, 0.3);
}
.style-3 .btn-secondary:hover {
    background: #424242;
    border-color: #424242;
    box-shadow: 0 4px 15px rgba(66, 66, 66, 0.4);
}
.style-3 .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.style-3 .table thead th {
    background: #f5f5f5;
    color: #0d47a1;
    font-weight: 600;
    border-bottom: 2px solid #1976d2;
}

/* Form Validation Feedback Styles */
.form-control.is-invalid,
.form-select.is-invalid,
textarea.is-invalid {
    border-color: #dc3545 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus,
textarea.is-invalid:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.35) !important;
}

/* Style for invalid select elements */
select.is-invalid {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"), url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-position: right 0.75rem center, center right 2.25rem;
    background-size: 16px 12px, calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Shake animation for invalid fields */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.is-invalid {
    animation: shake 0.5s ease-in-out;
}

/* Form validation error messages shown via alerts */
.alert-danger {
    border-left: 4px solid #dc3545;
}

/* Validation feedback within modals */
.modal .is-invalid + .invalid-feedback,
.modal-body .is-invalid + .invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 0.25rem;
}

/* Ensure error alerts in modals are visible and prominent */
.modal .alert-danger,
.modal-body .alert-danger {
    margin-top: 1rem;
    font-weight: 500;
}