/**
 * HC CBSE Affiliation Plugin Styles
 * Lightweight, responsive, with mobile card view
 */

.hc-cbse-affiliation-wrapper {
    width: 100%;
    max-width: 100%;
}

/* Table container for responsive handling */
.hc-cbse-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

.hc-cbse-main-title {
    margin-bottom: 20px;
    font-size: 28px;
    color: #333;
    word-wrap: break-word;
}

.hc-cbse-section-title {
    margin: 30px 0 10px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0px;
    color: #212052;
    word-wrap: break-word;
}

.hc-cbse-subsection-title {
    margin: 20px 0 10px;
    font-size: 18px;
    font-weight: 700;
    color: #212052;
    word-wrap: break-word;
}

/* Divider styling */
.hc-cbse-divider-container {
    max-width: 100px;
    margin-bottom: 15px;
}

.hc-cbse-divider-line {
    border-color: #c50227;
    border-width: 7px;
    border-style: solid;
    width: 100%;
}

/* Table styling - Desktop default */
.hc-cbse-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #D2D2D2;
    table-layout: auto;
}

.hc-cbse-table th,
.hc-cbse-table td {
    padding: 10px 12px;
    text-align: left;
    border: 1px solid #D2D2D2;
    word-wrap: break-word;
    word-break: break-word;
}

.hc-cbse-table th {
    background-color: #1C1B3B;
    font-weight: bold;
    color: #FFFFFF;
    border: none;
}

.hc-cbse-table tr.odd td {
    background-color: #E7E7E7;
}

.hc-cbse-table tr.even td {
    background-color: #FFFFFF;
}

.hc-cbse-table td {
    color: #000000;
}

.hc-cbse-table a {
    color: #007cba;
    text-decoration: none;
    word-wrap: break-word;
    word-break: break-all;
}

.hc-cbse-table a:hover {
    text-decoration: underline;
}

.hc-cbse-table img {
    display: inline-block;
    max-width: 30px;
    height: auto;
    vertical-align: middle;
}

/* ============================================
   MOBILE CARD VIEW - Only activates on small screens
   ============================================ */
@media (max-width: 640px) {
    
    .hc-cbse-main-title {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    .hc-cbse-section-title {
        font-size: 18px;
        margin: 20px 0 8px;
    }
    
    .hc-cbse-subsection-title {
        font-size: 16px;
        margin: 15px 0 8px;
    }
    
    .hc-cbse-divider-container {
        max-width: 80px;
        margin-bottom: 12px;
    }
    
    .hc-cbse-divider-line {
        border-width: 5px;
    }
    
    /* Convert tables to cards */
    .hc-cbse-table-container {
        overflow-x: visible;
    }
    
    .hc-cbse-table,
    .hc-cbse-table thead,
    .hc-cbse-table tbody,
    .hc-cbse-table th,
    .hc-cbse-table td,
    .hc-cbse-table tr {
        display: block;
    }
    
    /* Hide table headers */
    .hc-cbse-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    /* Each row becomes a card */
    .hc-cbse-table tr {
        border: 1px solid #D2D2D2;
        margin-bottom: 15px;
        border-radius: 5px;
        overflow: hidden;
    }
    
    /* Style each cell */
    .hc-cbse-table td {
        border: none;
        border-bottom: 1px solid #D2D2D2;
        position: relative;
        padding: 10px 12px 10px 50% !important;
        text-align: left;
        min-height: 40px;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
    }
    
    /* Add label before each cell value */
    .hc-cbse-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        width: 45%;
        padding-right: 10px;
        font-weight: bold;
        white-space: normal;
        color: #1C1B3B;
        font-size: 12px;
    }
    
    /* Remove border from last cell */
    .hc-cbse-table td:last-child {
        border-bottom: none;
    }
    
    /* Adjust image positioning */
    .hc-cbse-table img {
        margin-left: 0;
        max-width: 24px;
    }
    
    /* Smaller text on mobile */
    .hc-cbse-table td {
        font-size: 12px;
    }
    
    .hc-cbse-table td:before {
        font-size: 11px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .hc-cbse-main-title {
        font-size: 20px;
    }
    
    .hc-cbse-section-title {
        font-size: 16px;
    }
    
    .hc-cbse-table td {
        padding: 8px 10px 8px 50% !important;
        font-size: 11px;
    }
    
    .hc-cbse-table td:before {
        font-size: 10px;
    }
}