/* Examenes Styles - Mobile First Approach */

:root {
    --primary-color: #225581;
    --primary-dark: #14435e;
    --accent-color: #81dd36;
    --text-light: #FFFFFF;
    --text-dark: #333333;
    --bg-light: #F7F7F7;
    --bg-lighter: #FFFFFF;
    --border-light: #E0E0E0;
    --link-color: #2496ca;
    --weekend-color: #5A74A0;
    --weekend-light: #B0CCFF;
}

/* Base styles for mobile */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.contenido {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.contenido h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
}

.calendario {
    background-color: var(--bg-lighter);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 15px 10px;
    overflow-x: auto;
    width: 100%;
}

/* Calendar navigation controls */
.calendario form p {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

/* Form controls - make selectors more specific to calendar forms only */
.calendario input[type="button"] {
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
}

.calendario input[type="button"]:hover {
    background-color: var(--primary-dark);
}

.calendario input[type="text"] {
    padding: 6px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

/* Table styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    border: 1px solid var(--border-light);
    table-layout: fixed;
}

thead td {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 8px 4px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
}

/* Day name truncation with ellipsis */
.day-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Weekend days are already abbreviated */
.day-name.weekend {
    font-size: 13px;
}

thead td[bgcolor="#5A74A0"] {
    background-color: var(--weekend-color);
}

tbody td {
    padding: 6px 4px;
    border: 1px solid var(--border-light);
    vertical-align: top;
    min-height: 60px;
    font-size: 13px;
    word-wrap: break-word;
    overflow: hidden;
}

tbody td[bgcolor="#B0CCFF"] {
    background-color: var(--weekend-light);
}

/* Hide weekend columns on small screens */
@media screen and (max-width: 600px) {
    thead td:nth-child(6),
    thead td:nth-child(7),
    tbody td:nth-child(6),
    tbody td:nth-child(7) {
        display: none;
    }
    
    thead td {
        font-size: 12px;
        padding: 6px 2px;
    }
    
    tbody td {
        font-size: 11px;
        padding: 4px 2px;
    }
    
    tbody td b {
        display: block;
        margin-bottom: 4px;
    }
    
    .calendario {
        padding: 10px 5px;
    }
}

/* Medium screens */
@media screen and (min-width: 601px) and (max-width: 767px) {
    thead td {
        font-size: 13px;
        padding: 8px 4px;
    }
    
    tbody td {
        font-size: 12px;
        padding: 6px 4px;
    }
    
    thead td:nth-child(6),
    thead td:nth-child(7) {
        width: 40px !important;
    }
}

@media screen and (min-width: 768px) {
    .contenido {
        padding: 30px;
    }
    
    .calendario {
        padding: 25px;
    }
    
    thead td {
        padding: 10px;
        font-size: 15px;
    }
    
    tbody td {
        padding: 8px;
        font-size: 14px;
    }
}

/* Large screens */
@media screen and (min-width: 992px) {
    .contenido {
        padding: 40px;
    }
    
    .calendario {
        padding: 30px;
    }
    
    tbody td {
        min-height: 80px;
    }
}

/* Fix for images in calendar cells */
tbody td img {
    max-width: 25px;
    height: auto;
    vertical-align: middle;
    margin-right: 3px;
}

/* Fix for the absolute positioned element */
#capa6 {
    display: none; /* Hide this element as it seems to be causing layout issues */
}
