/* ====== General Container Styling ====== */
.eh-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.eh-container {
    font-family: Arial, sans-serif;
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    color: #222;
    font-size: 16px;
}

.eh-container h1,
.eh-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #111;
}

/* ====== Alert Messages ====== */
.eh-alert-success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}

.eh-alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}

/* ====== Group Editor Specific Styles ====== */
.eh-group-editor {
    max-width: 1000px;
}

.eh-groups-container {
    flex: 1;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    margin-bottom: 20px;
}

.eh-no-groups {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    font-size: 18px;
}

/* ====== Desktop View (Default) ====== */
.eh-mobile-view {
    display: none;
}

.eh-desktop-view {
    height: 100%;
    overflow-y: auto;
    max-height: 60vh;
}

.eh-groups-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.eh-groups-table thead th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 12px 8px;
    font-weight: 600;
    color: #495057;
    z-index: 10;
}

.eh-groups-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.eh-groups-table tbody tr:hover {
    background-color: #f8f9fa;
}

.eh-groups-table tbody tr:last-child {
    border-bottom: none;
}

.eh-groups-table td {
    padding: 12px 8px;
    vertical-align: middle;
    border: none;
}

.eh-group-id {
    width: 80px;
    text-align: center;
    font-weight: 600;
    color: #6c757d;
}

.eh-group-current {
    width: 35%;
    font-weight: 500;
}

.eh-group-edit {
    width: 45%;
}

.eh-group-actions {
    width: 80px;
    text-align: center;
}

.eh-group-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.eh-group-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.25);
}

/* ====== Delete Button Styling ====== */
.eh-btn-delete {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #dc3545;
    background-color: #fff;
    color: #dc3545;
    border-radius: 6px;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eh-btn-delete:hover {
    background-color: #dc3545;
    color: #fff;
    transform: scale(1.05);
}

/* ====== Mobile View (Cards) ====== */
@media (max-width: 768px) {
    .eh-desktop-view {
        display: none;
    }
    
    .eh-mobile-view {
        display: block;
        padding: 10px;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .eh-group-card {
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        margin-bottom: 16px;
        padding: 16px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .eh-group-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }
    
    .eh-group-card:last-child {
        margin-bottom: 0;
    }
    
    .eh-group-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
        padding-bottom: 12px;
        border-bottom: 1px solid #e9ecef;
    }
    
    .eh-group-id-badge {
        background: #007cba;
        color: #fff;
        padding: 4px 12px;
        border-radius: 12px;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
    }
    
    .eh-btn-delete-mobile {
        padding: 6px 16px;
        font-size: 12px;
        background: #fff;
        color: #dc3545;
        border: 1px solid #dc3545;
        border-radius: 20px;
        font-weight: 600;
        text-transform: uppercase;
        transition: all 0.2s ease;
    }
    
    .eh-btn-delete-mobile:hover {
        background: #dc3545;
        color: #fff;
    }
    
    .eh-group-card-content {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    
    .eh-group-label {
        display: block;
        font-size: 12px;
        font-weight: 600;
        color: #6c757d;
        text-transform: uppercase;
        margin-bottom: 6px;
    }
    
    .eh-group-current-name {
        padding: 12px;
        background: #f8f9fa;
        border-radius: 6px;
        font-weight: 500;
        font-size: 16px;
        border: 1px solid #e9ecef;
    }
    
    .eh-group-input-mobile {
        width: 100%;
        padding: 12px 16px;
        border: 1px solid #ced4da;
        border-radius: 6px;
        font-size: 16px;
        background: #fff;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
        box-sizing: border-box;
    }
    
    .eh-group-input-mobile:focus {
        outline: none;
        border-color: #007cba;
        box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.25);
    }
}

/* ====== Save Button Styling ====== */
.eh-save-btn {
    width: 100%;
    max-width: 200px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    background: #007cba;
    color: #fff;
    border: 1px solid #007cba;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.eh-save-btn:hover {
    background: #005a87;
    border-color: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 124, 186, 0.3);
}

/* ====== Table Styling ====== */
.eh-table {
    width: 100%;
    background: #D8D8D8;
    border-collapse: collapse;
    margin-top: 20px;
    color: #222;
    font-size: inherit;
}

.eh-table th,
.eh-table td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: left;
}

.eh-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

/* ====== Button Styling ====== */
.eh-btn {
    padding: 10px 20px;
    font-size: 15px;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f0f0f0;
    font-weight: bold;
    color: #222;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, transform 0.1s;
}

.eh-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-1px);
}

.eh-btn-primary {
    background-color: #fff;
    color: #222;
    border-color: #ccc;
}

.eh-btn-primary:hover {
    background-color: #f5f5f5;
}

/* Disabled state */
.eh-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background-color: #ccc;
    color: #666;
    border-color: #ccc;
}

/* ====== List Styling ====== */
.eh-list ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.eh-list li {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    border-radius: 4px;
    margin-bottom: 5px;
    color: #222;
}

.eh-list li:hover {
    background-color: #f5f5f5;
    transform: translateX(2px);
}

/* ====== Scrollable Container Option ====== */
.eh-scrollable {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    margin-bottom: 20px;
}

.spc-password-field {
    width: 150px;
    padding: 5px;
    font-weight: bold;
    text-align: center;
}

/* Optional: style for button container */
.eh-button-container {
    text-align: center;
    margin-top: auto;
    padding-top: 10px;
}

/* ====== Responsive Adjustments ====== */
@media (max-width: 480px) {
    .eh-container {
        padding: 15px;
        margin: 10px;
        font-size: 14px;
    }
    
    .eh-container h1,
    .eh-container h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .eh-group-card {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .eh-group-card-header {
        margin-bottom: 12px;
        padding-bottom: 8px;
    }
    
    .eh-group-id-badge {
        font-size: 11px;
        padding: 3px 10px;
    }
    
    .eh-btn-delete-mobile {
        font-size: 11px;
        padding: 5px 12px;
    }
    
    .eh-group-input-mobile {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 14px;
    }
    
    .eh-save-btn {
        width: 100%;
        max-width: none;
        padding: 16px 20px;
        font-size: 16px;
    }
}

/* ====== Breadcrumb Styling ====== */
#shcp-breadcrumb,
.eh-breadcrumb {
    margin-bottom: 15px;
    font-size: 14px;
    color: #222;
}

.eh-breadcrumb a {
    text-decoration: underline;
    cursor: pointer;
    color: #222;
}

.eh-breadcrumb a:hover {
    color: #0073aa;
}

.shcp-no-results {
    text-align: center;
    color: #888;
    padding: 20px;
}

.eh-dropdown {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 16px;
    margin-bottom: 15px;
}

/* ====== Student Homework Checker Plugin - Custom Styles ====== */
.shcp-sentence-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.shcp-sentence-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 4px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.shcp-sentence-row:hover {
    background: #f0f0f0;
}

.shcp-thumbnail {
    flex-shrink: 0;
    margin-right: 12px;
}

.shcp-thumbnail img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.shcp-sentence-text {
    flex: 1;
    font-weight: 500;
    color: #333;
    margin-right: 12px;
    word-break: break-word;
}

.shcp-audio-controls {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.shcp-play-btn,
.shcp-delete-btn {
    min-width: 40px;
    height: 36px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.shcp-play-btn:hover {
    background: #e8f5e8;
    border-color: #4CAF50;
    color: #4CAF50;
}

.shcp-play-btn:disabled {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
    cursor: not-allowed;
}

.shcp-delete-btn:hover {
    background: #ffeaea;
    border-color: #f44336;
    color: #f44336;
}

.shcp-no-audio {
    color: #999;
    font-style: italic;
    font-size: 14px;
}

.shcp-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.shcp-loading-spinner {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.shcp-loading-spinner::after {
    content: "Loading...";
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .shcp-sentence-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }
    .shcp-thumbnail {
        margin-right: 0;
        margin-bottom: 8px;
        align-self: center;
    }
    .shcp-sentence-text {
        margin-right: 0;
        margin-bottom: 8px;
        text-align: center;
        width: 100%;
    }
    .shcp-audio-controls {
        align-self: center;
    }
}

/* ====== Recorder Widget Styles ====== */
.arp-recorder-container {
    margin: 20px auto;
    padding: 15px;
    border: 2px solid #ccc;
    max-width: 400px;
    background: #f9f9f9;
    border-radius: 8px;
    font-family: Arial, sans-serif;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.arp-section {
    min-height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}
.arp-image-container {
    min-height: 200px;
    max-height: 60vh; /* ✅ ADD THIS */
    border: 1px solid #ccc;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
#arp-random-image {
    max-width: 100%;
    max-height: 60vh; /* ✅ CHANGE FROM 100% */
    width: auto; /* ✅ ADD THIS */
    height: auto; /* ✅ ADD THIS */
    object-fit: contain;
}
#arp-chapter-select {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
#arp-audio-preview {
    width: 100%;
}
.arp-timer-container {
    min-height: 30px;
}
#arp-timer-display {
    font-size: 24px;
    font-weight: bold;
    color: #0073aa;
    margin-left: 10px;
}
.hidden {
    display: none !important;
}
#arp-status-msg {
    margin-left: 5px;
}
#arp-status-icon {
    font-size: 1.2em;
}
.arp-button-controls {
    display: flex;
    gap: 10px;
}
.arp-button-controls button {
    flex: 1;
}
.arp-upload-controls {
    display: flex;
    gap: 10px;
}
.arp-upload-controls button {
    flex: 1;
}
#arp-start-btn,
#arp-upload-btn {
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
}
#arp-start-btn:hover,
#arp-upload-btn:hover {
    background-color: #005a87;
}
.arp-image-placeholder {
    color: #888;
    font-style: italic;
    font-size: 1.1em;
}



/* Adjust for tablets and smaller screens */
@media (max-width: 768px) {
    .arp-image-container {
        max-height: 50vh;
        min-height: 150px; /* ✅ Reduce min-height for tablets */
    }
    
    #arp-random-image {
        max-height: 50vh;
    }
}

/* Adjust for mobile phones */
@media (max-width: 480px) {
    .arp-image-container {
        max-height: 25vh;
        min-height: 120px; /* ✅ Further reduce for phones */
    }
    
    #arp-random-image {
        max-height: 25vh;
    }
}



/* Compact table adjustments */
.eh-table th, .eh-table td {
    padding: 4px 6px;
    font-size: 14px;
}

.eh-table .sticky-col {
    left: 0;
    background: #f8f9fa;
    font-weight: 600;
}

/* Present / Absent styling */
.present { color: #28a745; font-weight: bold; }
.absent { color: #dc3545; font-weight: bold; }

/* Scrollable wrapper */
.eh-table-wrapper {
    overflow-x: auto;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .eh-table {
        font-size: 13px;
    }
}



