/* ==================================== */
/* convocatoria.css - CORREGIDO PARA MÓVILES */
/* ==================================== */

/* --- HERO SECTION (consistente) --- */
.convocatoria-hero {
    background-color: var(--color-light-gray);
    color: var(--color-dark);
    padding: 60px 20px;
    text-align: center;
}

.convocatoria-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--color-primary);
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: block;
    width: auto;
    margin-left: auto;
    margin-right: auto;
    border-bottom: 3px solid var(--color-secondary);
}

.convocatoria-hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    color: var(--color-dark);
}

/* =======================================================
    SECCIÓN DE CONTENIDO CON FONDO RESPONSIVO
    ======================================================= */
.convocatoria-content-section {
    padding: 200px 20px;
    min-height: 70vh;
    display: flex;
    align-items: center;
    
    /* Propiedades comunes para todas las imágenes */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: scroll;
}

/* Imágenes diferentes por breakpoint - Versión sin "v2" */
@media (min-width: 1920px) {
    .convocatoria-content-section {
        background-image: url('../img/background/background-xxlage.png');
    }
}

@media (min-width: 1200px) and (max-width: 1919px) {
    .convocatoria-content-section {
        background-image: url('../img/background/background-large.png');
        min-height: 65vh;
        padding: 40px 20px;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .convocatoria-content-section {
        background-image: url('../img/background/background-medium.png');
        min-height: 60vh;
        padding: 160px 20px;
    }
}

@media (min-width: 480px) and (max-width: 767px) {
    .convocatoria-content-section {
        background-image: url('../img/background/background-small.png');
        min-height: 50vh;
        padding: 100px 20px;
    }
}

@media (max-width: 479px) {
    .convocatoria-content-section {
        background-image: url('../img/background/background-mobile.png');
        min-height: 40vh;
        padding: 80px 15px;
    }
}

/* FALLBACK */
.convocatoria-content-section {
    background-image: url('../img/background/background-large.png');
}

.container1 {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* =======================================================
    EFECTO VIDRIO (Glassmorphism)
    ======================================================= */
.glass-effect {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    
    /* Estilos base */
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    
    /* Mejora de contraste para el texto */
    color: var(--color-white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Variante para tarjetas internas */
.glass-effect-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    color: var(--color-white);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.glass-effect-card:hover {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* =======================================================
    SECCIONES DE CONVOCATORIA
    ======================================================= */
.convocatoria-section {
    margin-bottom: 40px;
    border-radius: 16px;
}

.section-title {
    color: white;
    border-bottom: 3px solid var(--color-accent);
    padding-bottom: 10px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.section-title i {
    font-size: 1.5rem;
    color: var(--color-accent);
}

/* --- DETALLES DE CONTENIDO --- */
.content-details {
    margin-bottom: 25px;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.content-details p {
    text-align: justify;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
}

.content-details h3 {
    color: white;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.3em;
}

.content-details h3 i {
    color: var(--color-accent);
}

.content-details ul {
    padding-left: 20px;
    color: rgba(255, 255, 255, 0.95);
}

.content-details li {
    margin-bottom: 8px;
    line-height: 1.6;
    text-align: justify;
}

.content-details strong {
    color: var(--color-accent);
}

/* --- LISTA DE REQUISITOS --- */
.requirements-list {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
    border-left: 4px solid var(--color-accent);
}

/* --- TABLA DE MODALIDADES --- */
.modality-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
}

.modality-table th {
    background: rgba(242, 92, 5, 0.3);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 1em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.modality-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.5;
}

.modality-table tr:last-child td {
    border-bottom: none;
}

.modality-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.05);
}

.modality-table tr:hover {
    background: rgba(242, 92, 5, 0.1);
}

.modality-table strong {
    color: var(--color-accent);
}

/* =======================================================
    GRID DE ROLES - CORREGIDO para móviles
    ======================================================= */
.roles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.role-card {
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px 15px;
}

.role-card h4 {
    color: white;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
    border-bottom: 2px solid rgba(242, 92, 5, 0.3);
    padding-bottom: 8px;
    word-break: break-word;
}

.role-card h4 i {
    color: var(--color-accent);
}

.role-card p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    margin: 0;
    font-size: 0.9rem;
    word-break: break-word;
}

/* =======================================================
    SECCIÓN DE DESCARGA - CORREGIDA para móviles
    ======================================================= */
.download-section {
    text-align: center;
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 25px;
    background: var(--color-primary);
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: none;
    cursor: pointer;
    min-width: 0;
    flex: 1 1 auto;
    max-width: 350px;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(242, 92, 5, 0.4);
    background: var(--color-accent);
    color: white;
    text-decoration: none;
}

/* Botón Primario */
.download-btn.btn-primary-conv {
    background: var(--color-accent);
    box-shadow: 0 4px 15px rgba(242, 92, 5, 0.3);
}

.download-btn.btn-primary-conv:hover {
    background: var(--color-secondary);
}

/* Botón DESHABILITADO */
.download-btn.btn-disabled {
    background: #95a5a6 !important;
    color: white !important;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

.download-btn.btn-disabled:hover {
    transform: none !important;
    background: #95a5a6 !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    cursor: not-allowed;
}

.download-btn i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.file-info {
    margin-top: 20px;
    padding: 15px;
    display: inline-block;
    max-width: 100%;
    box-sizing: border-box;
}

.file-info p {
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.9rem;
    word-wrap: break-word;
}

.file-info strong {
    color: var(--color-accent);
}

/* =======================================================
    RESPONSIVE MEJORADO - CORRECCIONES ESPECÍFICAS
    ======================================================= */

/* Tablets grandes y laptops pequeñas */
@media (max-width: 1100px) {
    .roles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 992px) {
    .glass-effect {
        padding: 25px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .convocatoria-hero h1 {
        font-size: 2rem;
    }
    
    .convocatoria-hero p {
        font-size: 1rem;
    }
    
    .convocatoria-content-section {
        padding: 150px 20px;
    }
    
    .section-title {
        font-size: 1.5em;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .content-details h3 {
        font-size: 1.2em;
        flex-wrap: wrap;
    }
    
    .role-card {
        padding: 15px;
    }
    
    .download-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .download-btn {
        width: 100%;
        max-width: 100%;
        padding: 16px 20px;
        font-size: 1rem;
        justify-content: center;
    }
    
    .modality-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modality-table th,
    .modality-table td {
        white-space: nowrap;
        min-width: 150px;
        padding: 10px 12px;
    }
}

/* Móviles grandes - CORRECCIÓN PARA ROLES */
@media (max-width: 600px) {
    .roles-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .role-card {
        text-align: left;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        padding: 18px;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .role-card h4 {
        justify-content: flex-start;
        margin-bottom: 8px;
        width: 100%;
        font-size: 1.1rem;
        border-bottom: 2px solid rgba(242, 92, 5, 0.3);
    }
    
    .role-card p {
        width: 100%;
        font-size: 0.95rem;
        padding-left: 0;
        margin-top: 5px;
        line-height: 1.5;
    }
}

/* Móviles pequeños - CORRECCIÓN PARA BOTONES */
@media (max-width: 480px) {
    .convocatoria-hero {
        padding: 40px 15px;
    }
    
    .convocatoria-hero h1 {
        font-size: 1.6rem;
        line-height: 1.3;
    }
    
    .convocatoria-content-section {
        padding: 80px 15px;
    }
    
    .glass-effect {
        padding: 20px 15px;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .section-title {
        font-size: 1.3em;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    /* CORRECCIÓN IMPORTANTE PARA BOTONES */
    .download-section {
        padding: 20px 15px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .download-buttons {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        margin: 20px 0;
    }
    
    .download-btn {
        width: 100%;
        max-width: 100%;
        padding: 16px 12px;
        font-size: 0.95rem;
        white-space: normal;
        text-align: center;
        line-height: 1.4;
        min-height: 60px;
        box-sizing: border-box;
        margin: 0;
        word-break: break-word;
    }
    
    .download-btn i {
        font-size: 1.2rem;
        margin-right: 8px;
        flex-shrink: 0;
    }
    
    .file-info {
        padding: 15px 12px;
        width: 100%;
        box-sizing: border-box;
        margin-top: 15px;
    }
    
    .file-info p {
        font-size: 0.85rem;
        word-break: break-word;
        line-height: 1.5;
    }
    
    .role-card {
        padding: 15px;
    }
    
    .role-card h4 {
        font-size: 1rem;
    }
    
    .role-card p {
        font-size: 0.9rem;
    }
}

/* iPhone 15 específico y dispositivos muy pequeños */
@media (max-width: 390px) {
    .download-btn {
        font-size: 0.9rem;
        padding: 14px 10px;
        min-height: 70px;
    }
    
    .download-btn i {
        font-size: 1.1rem;
    }
    
    .role-card h4 {
        font-size: 0.95rem;
    }
    
    .role-card p {
        font-size: 0.85rem;
    }
    
    .section-title {
        font-size: 1.2em;
    }
    
    .file-info p {
        font-size: 0.8rem;
    }
}

/* Dispositivos muy pequeños */
@media (max-width: 320px) {
    .download-btn {
        font-size: 0.85rem;
        padding: 12px 8px;
        min-height: 80px;
    }
    
    .download-btn i {
        font-size: 1rem;
    }
    
    .role-card {
        padding: 12px;
    }
    
    .role-card h4 {
        font-size: 0.9rem;
    }
    
    .role-card p {
        font-size: 0.8rem;
    }
}

/* =======================================================
    OPTIMIZACIÓN PARA DISPOSITIVOS SIN BACKDROP-FILTER
    ======================================================= */
@supports not (backdrop-filter: blur(12px)) {
    .glass-effect,
    .glass-effect-card,
    .requirements-list {
        background: rgba(255, 255, 255, 0.9);
        color: var(--color-dark);
        text-shadow: none;
    }
    
    .glass-effect .section-title,
    .glass-effect h3,
    .glass-effect-card h4 {
        color: var(--color-primary);
        text-shadow: none;
    }
    
    .glass-effect p,
    .glass-effect li,
    .glass-effect-card p,
    .content-details p,
    .content-details li {
        color: var(--color-dark);
        text-shadow: none;
    }
    
    .modality-table th {
        background: var(--color-primary);
    }
    
    .modality-table td {
        color: var(--color-dark);
    }
    
    .role-card h4 {
        color: var(--color-primary);
    }
    
    .role-card p {
        color: var(--color-dark);
    }
}

/* Mejoras de accesibilidad */
.download-btn:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}