/* Custom styles for HPV Bitácora Application */

/* Root variables for consistency */
:root {
    --hpv-primary: #0d6efd;
    --hpv-secondary: #6c757d;
    --hpv-success: #198754;
    --hpv-info: #0dcaf0;
    --hpv-warning: #ffc107;
    --hpv-danger: #dc3545;
    --hpv-light: #f8f9fa;
    --hpv-dark: #212529;
    --hpv-bg: #ffffff;
    --hpv-text: #212529;
    --hpv-border: #dee2e6;
}

/* Body and general layout improvements */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--hpv-bg);
    color: var(--hpv-text);
}

/* Enhanced card styling */
.card {
    border: 1px solid var(--hpv-border);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
    background-color: #ffffff;
}

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

/* Activity card specific styling */
.activity-card {
    transition: transform 0.2s ease-in-out;
}

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

/* Image styling improvements */
.activity-thumbnail {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: opacity 0.2s ease-in-out;
}

.activity-thumbnail:hover {
    opacity: 0.8;
}

/* File upload styling */
.file-upload-area {
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.375rem;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.15s ease-in-out;
}

.file-upload-area:hover {
    border-color: var(--bs-primary);
}

.file-upload-area.dragover {
    border-color: var(--bs-primary);
    background-color: rgba(13, 110, 253, 0.1);
}

/* Badge styling improvements */
.badge {
    font-size: 0.75em;
    font-weight: 500;
}

/* Button improvements */
.btn {
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

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

.nav-link {
    font-weight: 500;
    transition: color 0.15s ease-in-out;
}

/* Table improvements */
.table th {
    border-top: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.075);
}

/* Form improvements */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.is-invalid {
    border-color: var(--bs-danger);
}

.invalid-feedback {
    font-size: 0.875rem;
}

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

.alert-dismissible .btn-close {
    padding: 0.75rem 1rem;
}

/* Dashboard statistics cards */
.stats-card {
    border: none;
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-primary-rgb, 13, 110, 253));
    color: white;
    transition: transform 0.2s ease-in-out;
}

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

.stats-card .card-body {
    padding: 1.5rem;
}

.stats-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0;
}

.stats-card .card-title {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.9;
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--bs-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive improvements */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

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

/* Pagination improvements */
.pagination .page-link {
    border-radius: 0.375rem;
    margin: 0 0.125rem;
    border: 1px solid var(--bs-border-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Role-specific styling */
.role-ejecutor {
    border-left: 4px solid var(--bs-primary);
}

.role-regional {
    border-left: 4px solid var(--bs-info);
}

.role-nacional {
    border-left: 4px solid var(--bs-success);
}

.role-administrador {
    border-left: 4px solid var(--bs-warning);
}

/* Activity detail page improvements */
.activity-detail .row > div {
    margin-bottom: 0.5rem;
}

.activity-detail .row:last-child > div {
    margin-bottom: 0;
}

/* Image modal improvements */
.modal-lg {
    max-width: 90vw;
}

.modal-body img {
    max-height: 70vh;
    object-fit: contain;
}

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

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

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

/* Print styles */
@media print {
    .navbar,
    .btn,
    .pagination,
    footer {
        display: none !important;
    }
    
    .container {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
}
