/**
 * Estilos para el frontend del módulo Nosolorol Mecenazgos
 * Versión ordenada y optimizada
 */

/* ===== ESTILOS GENERALES ===== */
.mecenazgos-container {
    margin: 20px 0;
    font-family: inherit;
}

.mecenazgos-heading {
    margin-bottom: 20px;
    font-weight: 600;
    color: #232323;
    position: relative;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f1f1;
}

.mecenazgos-description {
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Enlaces generales y botones */
.back-to-list {
    display: inline-block;
    margin-bottom: 20px;
    color: #2fb5d2;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-to-list:hover {
    color: #1e94ab;
    text-decoration: underline;
}

.back-to-list i {
    margin-right: 5px;
}

.back-link {
    color: #868686;
}

a.back-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

a.bnt.back-list {
    display: inline-block;
    margin-bottom: 20px;
    color: #2fb5d2;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-primary-mecenazgo {
    background-color: #2fb5d2;
    color: white;
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary-mecenazgo:hover {
    background-color: #1e94ab;
}

/* ===== LISTADO DE MECENAZGOS ===== */
.mecenazgo-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mecenazgo-item {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: box-shadow 0.3s ease;
}

.mecenazgo-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.mecenazgo-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #232323;
}

.mecenazgo-description {
    color: #7a7a7a;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.mecenazgo-link {
    display: inline-block;
    padding: 8px 15px;
    background-color: #2fb5d2;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    font-weight: 600;
    font-size: 0.875rem;
}

.mecenazgo-link:hover {
    background-color: #1e94ab;
    color: white;
    text-decoration: none;
}

/* ===== TARJETAS DE MECENAZGO ===== */
.mecenazgo-card {
    padding: 20px;
    transition: all .2s ease-in;
    background: none;
}

.mecenazgo-card:hover {
    background-color: #222222;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 0.75rem 0rem;
    padding-bottom: 0rem;
    background: none;
    border-top: none;
}

.card-footer a {
    width: 100%;
}

/* ===== DETALLE DE PROYECTO ===== */
.project-detail {
    background-color: #fff;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 30px;
}

.project-detail-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #232323;
}

.project-description {
    font-size: large;
}

/* ===== FORMULARIOS DE MECENAZGO ===== */
.mecenazgo-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: large;
}

.form-group .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.form-group .form-control:focus {
    border-color: #2fb5d2;
    outline: none;
}

.form-group .help-text {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    color: #7a7a7a;
    font-style: italic;
}

.form-buttons {
    margin-top: 30px;
}

.form-text.text-muted {
    margin-top: -5px;
    margin-bottom: 10px !important;
    font-style: italic;
    text-align: right;
}

.form-group .text-center .btn-primary {
    min-width: 200px;
    padding: 10px 20px;
    font-weight: 600;
}

/* ===== TIPOS DE CAMPOS ===== */
.field-textarea {
    min-height: 100px;
    resize: vertical;
}

.field-checkbox {
    display: flex;
    align-items: center;
}

.field-checkbox input[type="checkbox"] {
    margin-right: 10px;
}

.field-date input[type="date"] {
    height: 38px;
}

.form-control-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-control-select option {
    padding: 8px;
}

.form-control-select option:first-child {
    font-style: italic;
    color: #6c757d;
}

.form-group.field-select {
    margin-bottom: 25px;
}

/* Ajustes para campos dentro de unidades */
.form-group.field-select select,
.form-group.field-text input,
.form-group.field-textarea textarea {
    width: 100%;
    max-width: 100%;
    margin-bottom: 5px;
}

/* ===== SECCIONES Y TÍTULOS ===== */
.section-title {
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 8px;
}

.section-title .badge {
    font-size: 0.75rem;
    font-weight: normal;
    vertical-align: middle;
    background-color: #25b9d7;
}

/* ===== ENCABEZADOS DE TARJETAS ===== */
.card-header {
    background-color: #ffb306;
    color: #000000;
}

.card-header-title {
    margin: 0;
    font-size: 1.2rem;
    color: #363a41;
    display: flex;
    align-items: center;
}

.card-header-title i {
    margin-right: 8px;
}

/* ===== BADGE Y ETIQUETAS ===== */
.badge-success {
    background-color: #78d07d;
    color: white;
}

.badge-warning {
    background-color: #fab000;
    color: white;
}

.badge-danger {
    background-color: #e74c3c;
    color: white;
}

.field-type-badge {
    background-color: #f4f9fb;
    color: #4a6572;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 8px;
}

/* ===== ALERTAS Y MENSAJES ===== */
.alert-mecenazgo {
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    border-left: 5px solid;
}

.alert-success-mecenazgo {
    background-color: #dff0d8;
    border-left-color: #78d07d;
    color: #3c763d;
}

.alert-info-mecenazgo {
    background-color: #d9edf7;
    border-left-color: #5bc0de;
    color: #31708f;
}

.alert-warning-mecenazgo {
    background-color: #fcf8e3;
    border-left-color: #f0ad4e;
    color: #8a6d3b;
}

.alert-danger-mecenazgo {
    background-color: #f2dede;
    border-left-color: #d9534f;
    color: #a94442;
}

.alert i {
    vertical-align: middle;
}

.newsletter-notice {
    padding: 15px;
    margin: 20px 0;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
    position: relative;
}

.newsletter-notice::before {
    content: '\f0a1';
    font-family: 'FontAwesome';
    margin-right: 10px;
    color: #7a7a7a;
}

/* ===== ESTADO DE PROYECTOS ===== */
.project-status-paused {
    padding: 3px 8px;
    background-color: #ffc107;
    color: #212529;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.85rem;
    display: inline-block;
    margin-bottom: 15px;
}

.project-paused {
    opacity: 0.7;
}

.project-paused input,
.project-paused textarea,
.project-paused select {
    background-color: #f8f8f8;
    cursor: not-allowed;
}

.paused-fields input,
.paused-fields textarea,
.paused-fields select {
    background-color: #f8f9fa;
    border-color: #e9ecef;
    cursor: not-allowed;
}

.alert-paused {
    background-color: #fef9e7;
    border-left: 3px solid #f39c12;
}

.alert-paused i {
    color: #f39c12;
    font-size: 24px;
    float: left;
    margin-right: 15px;
    vertical-align: middle;
}

/* ===== SECCIONES DE UNIDADES ===== */
.unit-section {
    border: 1px solid #414141;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.unit-title {
    font-size: 1.2rem;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
    display: block;
    width: 100%;
    margin-bottom: 25px;
}

/* ===== TABLAS Y LISTAS ===== */
.orders-section {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.table-danger {
    background-color: #fff3f2;
}

.incomplete-data {
    border-left: 3px solid #e74c3c;
}

.field-values-list {
    padding-left: 15px;
    margin: 0;
    list-style-type: none;
}

.field-values-list li {
    margin-bottom: 3px;
}

.missing-value {
    color: #e74c3c;
    font-style: italic;
    font-weight: 500;
}

/* ===== CHECKBOXES PERSONALIZADOS ===== */
.checkbox-group {
    margin-top: 5px;
}

.custom-control {
    position: relative;
    display: block;
    min-height: 1.5rem;
    padding-left: 1.5rem;
    margin-left: 1rem;
}

.custom-control-input {
    position: absolute;
    z-index: -1;
    opacity: 0;
}

.custom-control-label {
    position: relative;
    margin-bottom: 0;
    vertical-align: top;
    cursor: pointer;
    font-weight: normal !important;
    font-size: 1rem !important;
    padding-left: 10px;
}

.custom-control-label::before {
    position: absolute;
    top: 0.25rem;
    left: -1.5rem;
    display: block;
    width: 1rem;
    height: 1rem;
    pointer-events: none;
    content: "";
    background-color: #fff;
    border: 1px solid #adb5bd;
}

.custom-control-label::after {
    position: absolute;
    top: 0.25rem;
    left: -1.5rem;
    display: block;
    width: 1rem;
    height: 1rem;
    content: "";
    background: no-repeat 50% / 50% 50%;
}

.custom-control-input:checked ~ .custom-control-label::before {
    color: #fff;
    border-color: #2fb5d2;
    background-color: #2fb5d2;
}

.custom-control-input:checked ~ .custom-control-label::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e");
}

.custom-checkbox .custom-control-label::before {
    border-radius: 0.25rem;
}

/* ===== DATEPICKER ===== */
.ui-datepicker {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    width: 300px;
    z-index: 9999 !important;
}

.ui-datepicker .ui-datepicker-header {
    background: #ffb306;
    color: #000;
    border: none;
    border-radius: 4px 4px 0 0;
    padding: 10px;
}

.ui-datepicker .ui-datepicker-title {
    font-weight: bold;
}

.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
    cursor: pointer;
}

.ui-datepicker table {
    margin: 10px;
    width: calc(100% - 20px);
}

.ui-datepicker th {
    padding: 5px;
    text-align: center;
    font-weight: bold;
    border: 0;
    color: #333;
}

.ui-datepicker td {
    padding: 2px;
    text-align: center;
}

.ui-datepicker td a {
    display: block;
    padding: 5px;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    color: #333;
}

.ui-datepicker td a:hover {
    background-color: #f0f0f0;
}

.ui-datepicker td a.ui-state-active {
    background-color: #ffb306;
    color: #000;
}

.field-date .input-group-text {
    cursor: pointer;
    background-color: #f8f8f8;
}

.field-date .input-group-text:hover {
    background-color: #eee;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .unit-section {
        padding: 15px;
    }
    
    .unit-title {
        font-size: 1.1rem;
    }

    .project-detail {
        padding: 15px;
    }
    
    .btn-primary-mecenazgo {
        width: 100%;
    }
}

@media (max-width: 767px) {
    .table-responsive {
        border: 0;
        margin-bottom: 0;
    }
    
    .table-responsive .table {
        margin-bottom: 0;
    }
    
    .table-responsive .table td,
    .table-responsive .table th {
        white-space: normal;
    }
}

/* ===== ELEMENTOS PARA COMPATIBILIDAD ===== */
h2 {
    line-height: normal;
}