/* General styling for the course cards */
.clm-course-card {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 100%;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.clm-course-card h2 {
    font-size: 1.5em;
    margin-bottom: 8px;
}

.clm-course-card p {
    margin: 10px 0;
}

.clm-button-container {
    display: flex;
    justify-content: left;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* Styling for the buttons */
.clm-course-card button {
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 15px;
    cursor: pointer;
    width: 25%;
    min-width: 120px; /* Ensure the button has a minimum width */
    text-align: center;
    font-size: 1em;
    transition: background-color 0.3s ease;
    margin-right: 20px;
}

.clm-course-card button:hover {
    background-color: #005f8d;
}

/* Styling for the sub-accounts table */
.clm-sub-accounts-wrapper {
    margin-top: 20px;
    display: none;
    overflow-x: auto; 
    /* Make the table scrollable on small screens */
}

.clm-course-details-table {
    width: 100%;
    border-collapse: collapse;
    
}

.clm-course-details-table th, .clm-course-details-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.clm-course-details-table th {
    background-color: #f1f1f1;
}

.clm-course-details-table tbody tr:hover {
    background-color: #f9f9f9;
}

/* Dialog Styles */
.clm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px; /* Ensure some padding on mobile screens */
}

.clm-dialog {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    border: 1px solid lightgrey;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto; /* Ensure scrolling if content is too large */
    max-height: 90vh; /* Ensure the dialog doesn't exceed viewport height */
}

.clm-dialog h3 {
    margin-top: 0;
    font-size: 1.5rem;
    color: #333;
}

.clm-dialog p {
    font-size: 1rem;
    color: #555;
    margin-bottom: 1.5rem;
}

.clm-dialog label {
    font-size: 1rem;
    color: #333;
    margin-bottom: 5px;
    display: block;
}

.clm-dialog input[type="text"],
.clm-dialog input[type="email"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.clm-dialog button[type="submit"] {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    color: #fff;
    background-color: #004078;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.clm-dialog button[type="submit"]:hover {
    font-size: 1rem;
    background-color: #003366;
}

.clm-dialog button[type="button"] {
    font-size: 1rem;
    margin-top: 10px;
    background-color: #ccc;
    color: #333;
    border: none;
    padding: 10px;
    width: 100%;
    border-radius: 4px;
    cursor: pointer;
}

/* Loading Icon */
.clm-loading {
    display: flex;
    align-items: center;
    gap: 15px; /* Adds space between the icon and text */
    margin-top: 20px;
}

.loading-icon {
    width: 50px; /* Size of the loading icon */
    height: 50px;
    animation: rotate 1s linear infinite;
}

.loading-text {
    display: flex;
    flex-direction: column;
}

.loading-text span {
    font-weight: bold;
    font-size: 1.2em;
}

.loading-text p {
    font-size: 0.9em;
    color: #555;
    margin-top: 5px;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .clm-button-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .clm-course-card button {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .clm-course-details-table {
        min-width: 100%; /* Adjust the minimum width for smaller screens */
    }

    .clm-dialog {
        max-width: 100%; /* Ensure the dialog fits within the screen width */
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .clm-course-card h3 {
        font-size: 1.2em;
    }

    .clm-course-card p {
        font-size: 0.9em;
    }

    .clm-dialog h3 {
        font-size: 1.2rem;
    }

    .clm-dialog p {
        font-size: 0.9rem;
    }

    .clm-dialog {
        padding: 8px; /* Reduce padding for very small screens */
        padding-left: 20px; /* Add left padding */
        padding-right: 20px; /* Add right padding */
    }

    .clm-dialog input[type="text"],
    .clm-dialog input[type="email"] {
        font-size: 0.8rem; /* Adjust font size for smaller screens */
    }

    .clm-dialog button[type="submit"],
    .clm-dialog button[type="button"] {
        font-size: 0.9rem; /* Adjust button font size for smaller screens */
        padding: 6px; /* Adjust button padding for smaller screens */
    }
}
