/* General Styles */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Fix dropdown arrow overlap issue */
.pagination-select {
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;
    padding-right: 2.5rem !important;
    width: 90px !important;
    min-width: 90px !important;
}

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

/* Hero Section with VIGENT branding */
.hero-section {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #4a5daa 0%, #5b6bb8 50%, #dc3545 100%);
    color: white;
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background-image: url('/static/images/vigent-logo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.1;
    z-index: 1;
}

.hero-section .container {
    z-index: 2;
    position: relative;
}

/* Kanban Styles */
.kanban-board {
    margin-bottom: 2rem;
}

.kanban-column {
    margin-bottom: 1rem;
}

@media (min-width: 992px) {
    .kanban-column {
        min-height: 500px;
        max-height: 75vh;
    }
    
    .kanban-column-body {
        min-height: 400px;
        max-height: 65vh;
        overflow-y: auto;
        padding: 1rem;
    }
}

@media (max-width: 991.98px) {
    .kanban-column {
        min-height: 300px;
        max-height: 500px;
        margin-bottom: 1.5rem;
    }
    
    .kanban-column-body {
        min-height: 250px;
        max-height: 400px;
        overflow-y: auto;
        padding: 0.75rem;
    }
}

.kanban-column .card {
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: none;
}

.kanban-column .card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.kanban-column .card-header {
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.activity-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 0.5rem !important;
    height: fit-content;
}

.activity-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.activity-card .card {
    height: fit-content !important;
    min-height: auto;
    max-height: fit-content;
    border-radius: 8px;
    overflow: hidden;
}

.activity-card .card-body {
    padding: 0.5rem !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: fit-content !important;
    min-height: auto !important;
}

.activity-card .card-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.2rem !important;
    line-height: 1.2;
}

.activity-card .card-text {
    font-size: 0.75rem;
    margin-bottom: 0.3rem !important;
    line-height: 1.1;
}

.activity-card .small {
    font-size: 0.7rem;
    line-height: 1.1;
    margin-bottom: 0.3rem !important;
}

.activity-card .small div {
    margin-bottom: 0.1rem;
}

.activity-card .small div:last-child {
    margin-bottom: 0;
}

.activity-card .mt-2 {
    margin-top: 0.4rem !important;
}

.activity-card .btn-sm {
    padding: 0.15rem 0.35rem;
    font-size: 0.65rem;
    line-height: 1.1;
    margin-right: 0.25rem;
    margin-bottom: 0;
}

.activity-card .badge {
    font-size: 0.6rem;
    padding: 0.15rem 0.3rem;
}

.activity-card .d-flex.justify-content-between.align-items-start {
    margin-bottom: 0.3rem !important;
}

.activity-card .mb-2 {
    margin-bottom: 0.2rem !important;
}

.activity-card .mb-1 {
    margin-bottom: 0.15rem !important;
}

/* Drag and drop visual improvements */
.drag-over {
    background-color: #e3f2fd !important;
    border: 2px dashed #2196f3 !important;
    transition: all 0.2s ease;
}

.activity-card {
    cursor: grab;
    transition: all 0.3s ease;
}

.activity-card:active {
    cursor: grabbing;
}

.activity-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    transform: translateY(-2px);
}

.activity-card[draggable="true"] {
    user-select: none;
}

/* Smooth animations for status updates */
.kanban-column-body {
    transition: background-color 0.2s ease;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Custom scrollbar for kanban columns */
.kanban-column-body::-webkit-scrollbar {
    width: 8px;
}

.kanban-column-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.kanban-column-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.kanban-column-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Activity modal styling improvements */
#activityModal .modal-body {
    padding: 1.5rem;
}

#activityModal .modal-body h6 {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#activityModal .modal-body p {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #e9ecef;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
}

#activityModal .row {
    margin-bottom: 1.5rem;
}

#activityModal .col-md-4,
#activityModal .col-md-6,
#activityModal .col-md-8 {
    padding: 0.75rem;
}

#activityModal .badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

#activityModal hr {
    margin: 2rem 0 1.5rem 0;
    border-top: 2px solid #dee2e6;
}

/* Comment section styling */
#activityModal .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
}

#activityModal .form-control {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.75rem;
}

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

#activityModal #materials-list {
    min-height: 2rem;
    margin-bottom: 1rem;
}

#activityModal .btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

#activityModal #comments-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

#activityModal .comment-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

#activityModal .comment-header {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Fix dropdown z-index issues in kanban cards */
.activity-card .btn-group {
    position: relative;
    z-index: 10;
}

.activity-card .dropdown-menu {
    z-index: 1050 !important;
    position: absolute !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
    border: 1px solid #dee2e6 !important;
}

.activity-card .dropdown-toggle {
    z-index: 11;
}

/* Ensure dropdowns appear above other cards */
.activity-card:has(.dropdown-menu.show) {
    z-index: 100 !important;
    position: relative;
}

/* Date input styling */
input[type="date"] {
    position: relative;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input[type="date"]:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 0.2rem;
    margin-left: 0.5rem;
    border-radius: 0.25rem;
    background: #f8f9fa;
    border: none;
    transition: background-color 0.15s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background: #e9ecef;
}

/* Scrollbar styles for kanban columns */
.kanban-column-body::-webkit-scrollbar {
    width: 6px;
}

.kanban-column-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.kanban-column-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.kanban-column-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Public Purchase Card */
.public-purchase-card {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.public-purchase-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.public-purchase-card .card-body {
    border-radius: 15px;
}

/* System Cards */
.system-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

.system-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.system-icon {
    font-size: 4rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.system-name .badge {
    font-size: 0.8rem;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.system-card .btn {
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: #4a5daa;
    border-color: #4a5daa;
}

.btn-primary:hover {
    background-color: #3d4e95;
    border-color: #3d4e95;
}

.btn-success {
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-success:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Features Section */
.features-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-item {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
}

.feature-item i {
    color: #dc3545;
    font-size: 2rem;
    display: block;
}

/* Login Section with VIGENT branding */
.login-section {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #4a5daa 0%, #5b6bb8 50%, #dc3545 100%);
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.login-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background-image: url('/static/images/vigent-logo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.1;
    z-index: 1;
}

.login-section .container {
    z-index: 2;
    position: relative;
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: none;
}

.login-icon {
    font-size: 3rem;
}

/* Sidebar */
.sidebar {
    background-color: #343a40;
    min-height: calc(100vh - 56px);
    padding: 0;
}

.sidebar-content {
    padding: 2rem 1rem;
}

.sidebar-title {
    color: #adb5bd;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.sidebar .nav-link {
    color: #dee2e6;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    background-color: #495057;
    color: white;
}

.sidebar .nav-link.active {
    background-color: #007bff;
    color: white;
}

/* Main Content */
.main-content {
    padding: 2rem;
}

/* Dashboard Header */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h2 {
    color: #333;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.stat-content h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-content p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

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

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 15px 15px 0 0 !important;
    padding: 1.25rem 1.5rem;
}

.card-header h5, .card-header h6 {
    margin: 0;
    color: #495057;
    font-weight: 600;
}

/* Forms */
.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control-lg {
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
}

/* Buttons */
.btn {
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Tables */
.table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

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

.table td {
    padding: 1rem;
    vertical-align: middle;
}

/* Badges */
.badge {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

/* Pagination */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: 2px solid #dee2e6;
    color: #6c757d;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

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

/* List Groups */
.list-group-item {
    border: none;
    border-bottom: 1px solid #f1f3f4;
    padding: 1rem;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        min-height: auto;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .hero-section .container {
        padding: 2rem 1rem;
    }
    
    .system-icon {
        font-size: 3rem;
    }
    
    .stat-content h3 {
        font-size: 2rem;
    }
}

/* Custom Colors */
.bg-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
}

.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%) !important;
}

.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
}

.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
}

.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
}

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

/* Print Styles */
@media print {
    .sidebar, .navbar, .btn, .pagination {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
        margin: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

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

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

/* File Upload Styles */
.form-control[type="file"] {
    padding: 0.5rem;
}

.form-control[type="file"]::-webkit-file-upload-button {
    background-color: #007bff;
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-right: 1rem;
    cursor: pointer;
}

/* Modal Improvements */
.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #f1f3f4;
    border-radius: 15px 15px 0 0;
}

.modal-footer {
    border-top: 1px solid #f1f3f4;
    border-radius: 0 0 15px 15px;
}
