/* Entkreis Teacher Dashboard Styles */

/* Ensure our styles only apply to our specific components */
.entkreis-dashboard,
.entkreis-student-overview-page,
.entkreis-student-list-wrapper,
.entkreis-student-overview-wrapper {
    /* Scope container for all our styles */
}

.entkreis-dashboard-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.entkreis-dashboard-header h1 {
    margin-top: 0;
}

.entkreis-student-list-wrapper {
    margin-top: 20px;
}

/* Student list header */
.entkreis-student-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.entkreis-student-list-header h2 {
    margin: 0;
    color: #333;
}

.entkreis-student-count {
    background: #f0f0f1;
    padding: 5px 12px;
    border-radius: 3px;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

/* Search functionality */
.entkreis-student-search {
    margin-bottom: 15px;
}

.entkreis-student-search input {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.entkreis-student-search input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.entkreis-search-results {
    margin-top: 8px;
    color: #666;
    font-size: 13px;
}

.entkreis-student-list-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 12px;
}

.entkreis-student-list-table td {
    padding: 8px 12px !important;
    line-height: 1.4 !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #eee;
}

.entkreis-student-list-table th {
    padding: 12px;
    background: #f9f9f9;
    border-bottom: 2px solid #ddd;
    text-align: left;
    font-weight: bold;
    font-size: 13px;
}

/* Student info styling */
.entkreis-student-list-table .student-info {
    max-width: 250px;
}

.entkreis-student-list-table .student-email {
    font-weight: bold;
    color: #333;
    margin-bottom: 2px;
    font-size: 12px;
}

.entkreis-student-list-table .student-name {
    color: #666;
    font-size: 11px;
    line-height: 1.2;
}

/* Course status badges */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
}

.status-badge.completed {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.in-progress {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-badge.not-started {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-badge.pending-registration {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    font-style: italic;
}

/* Pending registration row highlight */
.entkreis-student-list-table tr.pending-user {
    background: #fffbf0;
}

.entkreis-student-list-table tr.pending-user .student-name {
    color: #856404;
    font-weight: 600;
    font-style: italic;
}

/* Ensure certificate column is always visible */
.entkreis-student-list-table th:last-child,
.entkreis-student-list-table td:last-child {
    display: table-cell !important;
    visibility: visible !important;
    width: auto !important;
    min-width: 150px !important;
}

.entkreis-student-list-table .certificate-actions-container {
    display: flex !important;
    gap: 3px !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
}

/* Smaller buttons with better padding */
.entkreis-student-list-table .certificate-actions-container .button {
    padding: 3px 6px !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
    margin: 0 2px 2px 0 !important;
    white-space: nowrap !important;
    border-radius: 3px !important;
    min-height: auto !important;
    
    /* Ensure all buttons (both <a> and <button>) have centered text */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    text-decoration: none !important;
    vertical-align: middle !important;
}

/* Exam date column styling */
.entkreis-student-list-table .exam-date {
    font-size: 12px;
    color: #333;
    white-space: nowrap;
}

.entkreis-student-list-table th:nth-child(1),
.entkreis-student-list-table td:nth-child(1) {
    width: 25%;
}

.entkreis-student-list-table th:nth-child(2),
.entkreis-student-list-table td:nth-child(2) {
    width: 30%;
}

.entkreis-student-list-table th:nth-child(3),
.entkreis-student-list-table td:nth-child(3) {
    width: 20%;
}

.entkreis-student-list-table th:nth-child(4),
.entkreis-student-list-table td:nth-child(4) {
    width: 25%;
    min-width: 200px;
}

.entkreis-student-list-table td:nth-child(1),
.entkreis-student-list-table td:nth-child(2) {
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entkreis-student-list-table thead th {
    background-color: #f9f9f9;
    font-weight: 600;
    color: #333;
}

.entkreis-student-list-table tbody tr:hover {
    background-color: #f5f5f5;
}

.entkreis-student-list-table .certificate-actions {
    text-align: right;
    white-space: nowrap;
}

.entkreis-student-list-table .certificate-actions .button {
    margin-left: 3px;
    vertical-align: middle;
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.4;
    min-height: auto;
    border-radius: 3px;
    text-decoration: none;
    display: inline-block;
}

.entkreis-student-list-table .certificate-actions .button:first-child {
    margin-left: 0;
}

.entkreis-student-list-table .button.button-primary.generate-certificate-btn {
    background-color: #0073aa;
    border-color: #006799;
    color: #fff;
    padding: 6px 12px;
    font-size: 12px;
}

.entkreis-student-list-table .button.button-primary.generate-certificate-btn:hover {
    background-color: #005a87;
    border-color: #004f74;
}

.entkreis-student-list-table .button.button-secondary {
    background-color: #f7f7f7;
    border-color: #ccc;
    color: #555;
}

.entkreis-student-list-table .button.button-secondary:hover {
    background-color: #fafafa;
    border-color: #999;
}

.entkreis-student-list-table .button.button-link-delete {
    background: #dc3545 !important;
    color: white !important;
    border: none !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    border-radius: 3px !important;
}

.entkreis-student-list-table .button.button-link-delete:hover {
    background: #c82333 !important;
}

/* Search and Filter Form Styles */
.entkreis-student-search-form {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.entkreis-search-form .search-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.entkreis-search-form .search-field {
    display: flex;
    flex-direction: column;
    min-width: 180px;
    flex: 1;
}

.entkreis-search-form .search-field label {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 13px;
    color: #333;
}

.entkreis-search-form .search-field input,
.entkreis-search-form .search-field select {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    height: 36px;
    box-sizing: border-box;
}

.entkreis-search-form .search-field select {
    background: white;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 30px;
    appearance: none;
    cursor: pointer;
}

.entkreis-search-form .search-field select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.entkreis-search-form .search-field input[type="checkbox"] {
    height: auto;
    width: auto;
    margin-right: 8px;
    vertical-align: middle;
}

.entkreis-search-form .search-field label:has(input[type="checkbox"]) {
    flex-direction: row;
    align-items: center;
    font-weight: normal;
    margin-bottom: 0;
    cursor: pointer;
}

.entkreis-search-form .search-actions {
    display: flex !important;
    gap: 8px !important;
    align-items: flex-end !important; /* Align with bottom of input fields */
    margin-bottom: 0 !important;
    height: 36px !important; /* Match input container height */
    justify-content: flex-start !important;
}

.entkreis-search-form .search-actions .button {
    height: 36px !important; /* Match input field height exactly */
    padding: 0 15px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    vertical-align: middle !important;
    border: 1px solid #ddd !important;
}

.entkreis-search-form .search-actions .button-primary {
    background: #0073aa;
    border-color: #0073aa;
    color: white;
}

.entkreis-search-form .search-actions .button-secondary {
    background: #f6f7f7;
    border-color: #ddd;
    color: #555;
}

.entkreis-search-form .search-actions .button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Active filters styling */
.entkreis-search-form .active-filters {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 10px 15px;
    margin-top: 10px;
    font-size: 13px;
}

.entkreis-search-form .filters-label {
    font-weight: bold;
    color: #495057;
    margin-right: 10px;
}

.entkreis-search-form .filter-tag {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
    border-radius: 12px;
    padding: 3px 8px;
    margin: 0 5px 0 0;
    font-size: 12px;
}

.entkreis-search-form .filter-tag .remove-filter {
    color: #d32f2f;
    text-decoration: none;
    margin-left: 5px;
    font-weight: bold;
}

.entkreis-search-form .filter-tag .remove-filter:hover {
    color: #b71c1c;
}

/* Pagination styles */
.entkreis-pagination {
    margin-top: 20px;
    padding: 15px 0;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.entkreis-pagination-info {
    color: #666;
    font-size: 14px;
}

.entkreis-pagination-links {
    display: flex;
    gap: 5px;
    align-items: center;
}

.entkreis-pagination-links .button {
    padding: 6px 12px;
    font-size: 13px;
    line-height: 1.3;
    min-height: auto;
    border-radius: 3px;
    text-decoration: none;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    transition: all 0.2s ease;
}

.entkreis-pagination-links .button:hover {
    background: #f5f5f5;
    border-color: #999;
    color: #000;
}

.entkreis-pagination-links .button.button-primary.current {
    background: #0073aa;
    border-color: #006799;
    color: #fff;
    cursor: default;
}

.entkreis-pagination-links .button.button-primary.current:hover {
    background: #0073aa;
    border-color: #006799;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .entkreis-student-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .entkreis-student-search input {
        max-width: 100%;
    }
    
    /* Mobile search form styles */
    .entkreis-search-form .search-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .entkreis-search-form .search-field {
        min-width: auto;
        margin-bottom: 10px;
    }
    
    .entkreis-search-form .search-actions {
        justify-content: flex-start;
        align-items: stretch;
    }
    
    .entkreis-search-form .search-actions .button {
        flex: 1;
        max-width: 120px;
    }
    
    .entkreis-pagination {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .entkreis-pagination-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .entkreis-student-list-table {
        font-size: 12px;
    }
    
    .entkreis-student-list-table th,
    .entkreis-student-list-table td {
        padding: 8px 10px;
    }
    
    .entkreis-student-list-table .certificate-actions .button {
        padding: 3px 6px;
        font-size: 10px;
        margin-left: 2px;
    }
    
    .certificate-actions-container {
        gap: 2px;
    }
    
    .entkreis-student-list-table th:nth-child(4),
    .entkreis-student-list-table td:nth-child(4) {
        min-width: 150px;
    }
}

@media (max-width: 480px) {
    .entkreis-student-list-table .certificate-actions .button {
        padding: 2px 4px;
        font-size: 9px;
    }
    
    .entkreis-student-list-table th:nth-child(4),
    .entkreis-student-list-table td:nth-child(4) {
        min-width: 120px;
    }
    
    .entkreis-pagination-links .button {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* Student Overview Styles */
.entkreis-student-overview-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.entkreis-overview-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.entkreis-overview-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.entkreis-overview-header .header-text {
    flex: 1;
    min-width: 300px;
}

.entkreis-overview-header .header-actions {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.entkreis-overview-header h1 {
    margin-top: 0;
    color: #333;
    font-size: 2.2em;
}

.entkreis-overview-header p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 0;
}

/* Download button styling */
#download-students-excel {
    white-space: nowrap;
    font-size: 14px;
    padding: 8px 16px;
    height: auto;
    line-height: 1.4;
}

#download-students-excel:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .entkreis-overview-header .header-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .entkreis-overview-header .header-actions {
        justify-content: flex-start;
        margin-top: 10px;
    }
}

/* The search form styles are now using the same classes as the main teacher dashboard */

/* Search Results Info */
.search-results-info {
    background: #e7f3ff;
    border: 1px solid #bee5eb;
    border-radius: 3px;
    padding: 10px 15px;
    margin-bottom: 20px;
}

.search-results-info p {
    margin: 0;
    color: #0c5460;
    font-weight: 500;
}

/* Students Count */
.students-count {
    margin-bottom: 15px;
}

.students-count p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* No Students Message */
.no-students-message {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.no-students-message p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Student Overview Table */
.entkreis-student-overview-wrapper {
    margin-top: 20px;
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

.entkreis-student-overview-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 5px;
    overflow: hidden;
}

.entkreis-student-overview-table th {
    background: #f8f9fa;
    color: #333;
    font-weight: 600;
    padding: 15px 12px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
}

.entkreis-student-overview-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.entkreis-student-overview-table tbody tr:hover {
    background: #f8f9fa;
}

.entkreis-student-overview-table tbody tr:last-child td {
    border-bottom: none;
}

/* Column specific styles */
.entkreis-student-overview-table .col-name {
    min-width: 200px;
}

.entkreis-student-overview-table .col-birthday {
    width: 120px;
    text-align: center;
}

.entkreis-student-overview-table .col-address {
    min-width: 180px;
}

.entkreis-student-overview-table .col-exam-date {
    width: 130px;
    text-align: center;
}

.entkreis-student-overview-table .col-course-status {
    min-width: 150px;
    text-align: center;
}

/* Name and Email styling */
.entkreis-student-overview-table .student-name {
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
    font-size: 15px;
}

.entkreis-student-overview-table .student-email {
    color: #666;
    font-size: 13px;
}

/* Address styling */
.entkreis-student-overview-table .address-street {
    font-weight: 500;
    color: #333;
    margin-bottom: 3px;
}

.entkreis-student-overview-table .address-city {
    color: #666;
    font-size: 13px;
}

/* Course Status Badges */
.course-status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.course-status-badge.successfully-passed {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.course-status-badge.in-progress {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.course-status-badge.not-passed {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Pending registration badge for Meine Kursteilnehmer table */
.course-status-badge.pending-registration {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    font-style: italic;
}

.entkreis-student-overview-table .course-name {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
    font-style: italic;
}

/* MasterStudy Course Builder Conflict Fixes for Student Overview */
.stm_lms_course_builder_wrapper .entkreis-student-overview-table {
    table-layout: auto !important;
}

.stm_lms_course_builder_wrapper .entkreis-student-overview-table td,
.stm_lms_course_builder_wrapper .entkreis-student-overview-table th {
    padding: 12px 8px !important;
    border: 1px solid #ddd !important;
    background: #fff !important;
}

.stm_lms_course_builder_wrapper .entkreis-student-overview-table .col-name {
    width: auto !important;
}

/* Responsive Design for Student Overview */
@media (max-width: 768px) {
    .entkreis-student-overview-page {
        padding: 15px;
    }
    
    .student-search-form .search-fields {
        flex-direction: column;
        align-items: stretch;
    }
    
    .student-search-form .search-actions {
        justify-content: center;
        margin-top: 10px;
    }
    
    .entkreis-student-overview-table {
        font-size: 13px;
    }
    
    .entkreis-student-overview-table th,
    .entkreis-student-overview-table td {
        padding: 10px 8px;
    }
    
    .entkreis-student-overview-table .col-birthday,
    .entkreis-student-overview-table .col-exam-date {
        width: auto;
        min-width: 100px;
    }
}

@media (max-width: 600px) {
    .entkreis-overview-header h1 {
        font-size: 1.8em;
    }
    
    .entkreis-student-overview-table,
    .entkreis-student-overview-table thead,
    .entkreis-student-overview-table tbody,
    .entkreis-student-overview-table th,
    .entkreis-student-overview-table td,
    .entkreis-student-overview-table tr {
        display: block;
    }
    
    .entkreis-student-overview-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .entkreis-student-overview-table tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 5px;
        background: #fff;
    }
    
    .entkreis-student-overview-table td {
        border: none;
        position: relative;
        padding: 8px 10px 8px 40%;
        margin-bottom: 5px;
    }
    
    .entkreis-student-overview-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 6px;
        width: 35%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: #333;
    }
    
    .course-status-badge {
        margin-left: 0;
    }
} 