.intv-container {
    max-width: 80%;
}

.intv-title {
    text-align: center;
    padding: 1rem 0;
    border-bottom: 1px solid #e1e1e1;
    font-family: 'Open Sans', sans-serif;
}

.intv-topics-grid {
    display: -webkit-box;      
    display: -ms-flexbox;    
    display: flex;             
    -webkit-flex-wrap: wrap;   
    -ms-flex-wrap: wrap;       
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    -webkit-justify-content: center; 
    -ms-flex-pack: center;           
    justify-content: center;
}

.intv-topics-grid > .intv-topic-box {
    margin: 10px;
}

.intv-topic-box {
    position: relative; 
    /* Flex properties with vendor prefixes */
    -webkit-box-flex: 1;       
    -ms-flex: 1 1 200px;      
    flex: 1 1 200px;         
    max-width: 300px;
    height: 325px;
    display: -webkit-box;      
    display: -ms-flexbox;      
    display: flex;            
    -webkit-flex-direction: column; /* Safari 6.1+ */
    -ms-flex-direction: column;     
    flex-direction: column;
    -webkit-align-items: center;    
    -ms-flex-align: center;       
    align-items: center;
    -webkit-justify-content: center; 
    -ms-flex-pack: center;        
    justify-content: center;
    /* Vendor prefixes for box-shadow */
    -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); 
    -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);    
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 25px 15px;
    background-color: #fff;
    /* Vendor prefixes for transition */
    -webkit-transition: transform 0.3s ease;
    transition: transform 0.3s ease;
    text-decoration: none;
    color: inherit;
    border-radius: 5px;
}

.intv-topic-box:hover {
    /* Vendor prefixes for box-shadow */
    -webkit-box-shadow: 0 0 15px rgba(0, 0, 0, 0.2); /* Safari */
    -moz-box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);    /* Firefox */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.intv-topic-image {
    height: 200px;
    width: 200px;
    display: block;
    margin-bottom: 20px;
    object-fit: cover;
    /* Fallback for object-fit */
    background-size: cover;
    background-position: center;
}

.intv-topic-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fallback for older browsers */
    background-size: cover;
    background-position: center;
}

.intv-topic-title {
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    padding: 7px 5px;
    margin: 7px 0;
    text-align: center;
    /* Ensure text is responsive */
    word-wrap: break-word;
}

.intv-no-topics {
    text-align: center;
    padding: 2rem 0;
    color: #888;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .intv-container {
        max-width: 90%;
    }
    
    .intv-topics-grid {
        -webkit-justify-content: flex-start;
        -ms-flex-pack: start;
        justify-content: flex-start;
    }

    .intv-topic-box {
        width: 100%;
        max-width: none;
        margin: 10px 0; 
    }
}

/* Styles for the badges */
.intv-premium-badge,
.intv-free-badge {
    position: absolute;
    top: 6px;
    left: -5px;
    padding: 5px 7px;
    font-size: 0.755rem;
    font-weight: bold;
    min-width: 60px;
    color: #fff;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    z-index: 1;
    text-transform: uppercase;
    /* Vendor prefixes for user-select */
    -webkit-user-select: none; 
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.intv-premium-badge {
    background-color: #d68100;
}

.intv-free-badge {
    background-color: #4caf50;
}

.intv-premium-badge:hover,
.intv-free-badge:hover {
    opacity: 0.9;
}




/* Interactive Topic Units Details ================================================== */
.trn-topic-container {
    max-width: 800px;
    width: 100%;
    margin: 40px auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    /* Vendor prefixes for box-shadow */
    -webkit-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.trn-topic-container h1 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 20px; 
    font-family: 'Open Sans', sans-serif; 
}

/* Intro Box */
.trn-intro-box {
    text-align: center;
    width: 100%;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-family: 'Open Sans', sans-serif;
}

/* Wide Image Box */
.trn-wide-image-box {
    width: 100%;
    margin-bottom: 20px; 
}

.trn-wide-image-box img {
    width: 100%;
    min-height: 350px;
    background-color: #f9f9f9;
    display: block;
    border-radius: 10px; 
    overflow: hidden;
    object-fit: cover;
    /* Fallback for object-fit */
    background-size: cover;
    background-position: center;
}

/* Fallback for object-fit in older browsers */
.no-objectfit .trn-wide-image-box img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    /* Hide the img and use background image instead */
    content: "";
    display: block;
}

/* Main Audio Section */
.trn-main-audio {
    margin-top: 20px;
    text-align: center;
}

/* Start Button */
#trn-start-btn {
    width: 30%;
    padding: 10px 20px;
    margin-top: 20px;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    /* Vendor prefixes for transition */
    -webkit-transition: background-color 0.3s;
    -moz-transition: background-color 0.3s;
    transition: background-color 0.2s;
    font-size: 16px;
    font-family: 'Open Sans', sans-serif;
}

#trn-start-btn:hover {
    background-color: #003a03;
}

/* Unit Box */
.trn-unit-box {
    text-align: left;
    padding: 20px;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-bottom: 20px; /* Add margin for spacing */
    /* Vendor prefixes for box-shadow */
    -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    -moz-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-family: 'Open Sans', sans-serif;
}

/* Question Box */
.trn-question-box {
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: bold;
}

/* Answers Grid */
.trn-answers-grid {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex; 
    -webkit-flex-direction: column;
    -ms-flex-direction: column; 
    flex-direction: column;
    gap: 10px;
}

.trn-answers-grid > .trn-answer-option {
    margin: 5px 0;
}

/* Answer Option */
.trn-answer-option {
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    background-color: #f9f9f9;
    /* Vendor prefixes for transition */
    -webkit-transition: background-color 0.3s;
    -moz-transition: background-color 0.3s;
    transition: background-color 0.3s;
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
}

.trn-answer-option:hover {
    background-color: #e9e9e9;
}

.trn-answer-option.correct {
    background-color: #4CAF50;
    color: white;
}

.trn-answer-option.wrong {
    background-color: #f44336;
    color: white;
}

/* Control Panel */
.trn-control-panel {
    margin-top: 20px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}

/* Next Button */
#trn-next-btn {
    padding: 10px 20px;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    -webkit-transition: background-color 0.3s;
    -moz-transition: background-color 0.3s;
    transition: background-color 0.3s;
    font-size: 16px;
    font-family: 'Open Sans', sans-serif;
}

#trn-next-btn:hover {
    background-color: #45a049;
}

/* End Card Styles ================================================== */
.trn-end-card {
    text-align: center;
    width: 100%;
    padding: 30px 20px;
    background-color: #f8f8f8;
    border-radius: 10px;
    border: 1px solid #ddd;
    /* Vendor prefixes for box-shadow */
    -webkit-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    font-family: 'Open Sans', sans-serif;
}

.trn-end-card h2 {
    font-size: 24px;
    margin-bottom: 20px;
    font-family: 'Open Sans', sans-serif;
}

.trn-end-card p {
    font-size: 18px;
    margin: 10px 0;
    font-family: 'Open Sans', sans-serif;
}

/* Exit Button */
#trn-exit-btn {
    padding: 10px 20px;
    cursor: pointer;
    background-color: #d9534f; 
    color: white;
    border: none;
    border-radius: 5px;
    margin-top: 20px;
    -webkit-transition: background-color 0.3s;
    -moz-transition: background-color 0.3s;
    transition: background-color 0.3s;
    font-size: 16px;
    font-family: 'Open Sans', sans-serif;
}

#trn-exit-btn:hover {
    background-color: #c9302c;
}




/* Responsive Styles ----------------------------- */
@media (max-width: 768px) {
    .trn-topic-container {
        max-width: 90%;
    }

    #trn-start-btn,
    #trn-next-btn,
    #trn-exit-btn {
        width: 100%;
    }

    .trn-control-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .trn-control-panel > * {
        margin-bottom: 10px;
    }

    .trn-control-panel > *:last-child {
        margin-bottom: 0;
    }

    .trn-answers-grid {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .trn-topic-container {
        max-width: 100%;
        padding: 15px 3px;
        margin: 40px 0;
    }

}


@supports not (gap: 10px) {
    .trn-answers-grid {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-flex-direction: column;
        -ms-flex-direction: column;
        flex-direction: column;
    }

    .trn-answers-grid > .trn-answer-option {
        margin-bottom: 10px;
    }

    .trn-answers-grid > .trn-answer-option:last-child {
        margin-bottom: 0;
    }
}
