/* Variables de Tema */
:root {
    --primary-color: #1a3a5f;
    --secondary-color: #e9b44c;
    --accent-color: #2a628f;
    --light-color: #f8f9fa;
    --dark-color: #16262e;
    --text-color: #333;
    --card-bg: #ffffff;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --header-height: 90px;
}

/* Estilos Generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f5f7fa;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 60px 0;
}

.section-title {
    font-size: 2.3rem;
    text-align: center;
    margin-bottom: 15px;
    color: var(--primary-color);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 70px;
    height: 4px;
    background: var(--secondary-color);
    margin: 15px auto 25px;
    border-radius: 2px;
}

.section-description {
    text-align: center;
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 30px;
    color: #555;
}

/* Barra de Búsqueda */
.search-container {
    max-width: 700px;
    margin: 0 auto 30px;
    position: relative;
}

#search {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e1e5ea;
    border-radius: 50px;
    font-size: 16px;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

#search:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(42, 98, 143, 0.2);
}

#search::placeholder {
    color: #a0aec0;
}

.results-count {
    text-align: center;
    margin-bottom: 30px;
    color: #4a5568;
    font-style: italic;
}

/* Cuadrícula de Proyectos */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.project-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.project-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.project-card:hover img {
    opacity: 0.9;
}

.project-info {
    padding: 20px;
}

.project-info h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.project-info p {
    margin-bottom: 15px;
    color: #4a5568;
    line-height: 1.6;
    font-size: 0.95rem;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

/* Modal */
.project-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    overflow-y: auto;
    padding: 30px 15px;
}

.modal-content {
    background: white;
    max-width: 900px;
    margin: 30px auto;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.4s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.close-modal:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

.modal-header {
    height: 350px;
    position: relative;
}

.modal-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.modal-header-content {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    padding: 0 30px;
    z-index: 2;
    color: white;
}

.modal-header-content h2 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.location-tag {
    display: inline-block;
    background: var(--secondary-color);
    color: var(--dark-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.type-tag {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-left: 8px;
}

.modal-body {
    padding: 30px;
}

.modal-description {
    margin-bottom: 25px;
    font-size: 1rem;
    line-height: 1.7;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.feature-item {
    display: flex;
    align-items: center;
}

.feature-icon {
    margin-right: 12px;
    color: var(--secondary-color);
    font-size: 1.3rem;
}

.feature-text {
    font-weight: 500;
    font-size: 0.95rem;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.btn-contact {
    background: var(--secondary-color);
    color: var(--dark-color);
}

.btn-contact:hover {
    background: #d9a336;
}

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 50px;
    gap: 6px;
}

.page-nav, .page-number, .page-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}


.page-nav {
    background: var(--primary-color);
    color: white;
}

.page-nav.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 14px;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--accent-color);
}

.pagination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.page-numbers {
    display: flex;
    gap: 8px;
    margin: 0 10px;
}

.page-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 4px;
    background: #e1e5ea;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 14px;
}

.page-number:hover {
    background: #d1d5db;
}

.page-number.active {
    background: var(--primary-color);
    color: white;
}

/* Responsive */
@media (max-width: 992px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-header {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 50px 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .projects-grid {
        gap: 20px;
    }
    
    .modal-body {
        padding: 25px 20px;
    }
    
    .modal-header-content {
        padding: 0 20px;
    }
    
    .modal-header-content h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-description {
        font-size: 1rem;
    }
    
    .modal-header {
        height: 220px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .page-numbers {
        order: 3;
        flex-basis: 100%;
        justify-content: center;
        margin: 10px 0;
    }
}

.page-number {
    background: #f0f4f8;
    color: #4a5568;
}

.page-number.active {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.page-dots {
    background: transparent;
    cursor: default;
}

.page-numbers {
    display: flex;
    gap: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
    }
    
    .page-nav, .page-number, .page-dots {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .pagination {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .page-numbers {
        order: 3;
        flex-basis: 100%;
        justify-content: center;
        margin: 10px 0;
    }
}

/* Cabecera del modal */
body.dark .modal-header-content {
    background: rgba(46, 46, 46, 0.8);
}


/* Añadir al final del archivo */
body.dark .project-modal {
    background: rgba(0, 0, 0, 0.9);
}

body.dark .modal-content {
    background: #2e2e2e;
    color: #e0e0e0;
}

body.dark .modal-header-content {
    color: #fff;
}

body.dark .location-tag {
    background: #e9b44c;
    color: #1a3a5f;
}

body.dark .type-tag {
    background: #2a628f;
    color: #fff;
}

body.dark .modal-description,
body.dark .feature-text {
    color: #e0e0e0;
}

body.dark .feature-icon {
    color: #e9b44c;
}

body.dark .btn {
    background: #1a3a5f;
    color: #fff;
}

body.dark .btn:hover {
    background: #2a628f;
}

body.dark .btn-contact {
    background: #e9b44c;
    color: #1a3a5f;
}

body.dark .btn-contact:hover {
    background: #d9a336;
}

body.dark-mode .project-info h3 {
    color: #6ba3d8 !important;
}

body.dark-mode .project-info p {
    color: #fff !important;
}