/* academy-progress-tracker/assets/css/apt-frontend.css */

.apt-error {
    background: #ffebe6;
    color: #c00;
    padding: 15px;
    border-left: 4px solid #c00;
    border-radius: 4px;
    margin: 20px 0;
}

.apt-notice {
    background: #fcf8e3;
    color: #8a6d3b;
    padding: 15px;
    border-left: 4px solid #eea236;
    border-radius: 4px;
    margin: 20px 0;
}

/* Search + sort controls */
.apt-frontend-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.apt-frontend-search {
    flex: 1;
    min-width: 220px;
}

.apt-frontend-search #apt-search-input {
    width: 100%;
    max-width: 320px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #E2E8F0;
    color: #1E3A8A;
    font-size: 0.9em;
}

.apt-frontend-search #apt-search-input:focus {
    outline: none;
    border-color: #1E3A8A;
    box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.15);
}

.apt-frontend-controls label {
    font-weight: 600;
    color: #1E3A8A;
    font-size: 0.9em;
}

.apt-frontend-controls select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #E2E8F0;
    color: #1E3A8A;
    font-size: 0.9em;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* Loading spinner */
.apt-frontend-loading {
    text-align: center;
    padding: 30px;
    display: none;
}

.apt-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #E2E8F0;
    border-top: 3px solid #1E3A8A;
    border-radius: 50%;
    animation: apt-spin 1s linear infinite;
}

@keyframes apt-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.apt-frontend-loading p {
    color: #666;
    margin-top: 10px;
    font-size: 0.9em;
}

/* Pagination controls */
.apt-pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.apt-page-btn {
    background: #1E3A8A;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.apt-page-btn:hover:not(:disabled) {
    background: #00AC6B;
}

.apt-page-btn:disabled {
    background: #E2E8F0;
    color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

.apt-page-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
}

.apt-page-number-btn {
    background: #fff;
    color: #1E3A8A;
    border: 1px solid #E2E8F0;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.apt-page-number-btn:hover:not(:disabled) {
    border-color: #1E3A8A;
    background: #eae8fa;
}

.apt-page-number-btn.apt-current,
.apt-page-number-btn:disabled {
    background: #1E3A8A;
    color: #fff;
    border-color: #1E3A8A;
    cursor: default;
}

.apt-page-ellipsis {
    color: #888;
    padding: 0 4px;
}

.apt-page-info {
    color: #1E3A8A;
    font-size: 0.9em;
    font-weight: 600;
}

/* Compact View */
.apt-compact-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.apt-compact-student {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-left: 4px solid #1E3A8A;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: box-shadow 0.2s ease, border-left-color 0.2s ease;
}

.apt-compact-student:hover {
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.15);
    border-left-color: #00AC6B;
}

.apt-student-name {
    font-size: 1.3em;
    font-weight: 700;
    color: #1E3A8A;
    margin-bottom: 5px;
}

.apt-student-login,
.apt-student-login-inline {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 15px;
    display: block;
}

.apt-student-login-inline {
    margin-left: 15px;
    display: inline-block;
}

.apt-compact-courses {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.apt-compact-course-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.apt-course-title {
    font-size: 0.9em;
    color: #1E3A8A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.apt-compact-progress-bar {
    background: #eae8fa;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
}

.apt-progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.apt-course-percent {
    font-size: 0.8em;
    color: #00AC6B;
    text-align: right;
    font-weight: 600;
}

/* Detailed View */
.apt-detailed-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.apt-detailed-student-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-top: 4px solid #1E3A8A;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.08);
}

.apt-student-header h3 {
    margin: 0 0 8px 0;
    color: #1E3A8A;
    font-size: 1.5em;
}

.apt-student-header .apt-student-email {
    color: #666;
    font-size: 0.9em;
    display: block;
}

.apt-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.apt-course-card {
    background: #eae8fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #E2E8F0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.apt-course-card.apt-complete {
    border-left-color: #00AC6B;
    background: #f0fdf4;
}

.apt-course-card.apt-in-progress {
    border-left-color: #2BDEA4;
    background: #eae8fa;
}

.apt-course-card.apt-not-started {
    border-left-color: #E2E8F0;
    background: #f8f9fa;
}

.apt-course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(30, 58, 138, 0.12);
}

.apt-course-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 1.05em;
}

.apt-course-progress {
    background: #e0e0e0;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.apt-course-bar {
    height: 100%;
    transition: width 0.3s ease;
}

.apt-course-stats {
    font-size: 0.85em;
    color: #888;
}

/* Responsive */
@media (max-width: 768px) {
    .apt-compact-courses,
    .apt-courses-grid {
        grid-template-columns: 1fr;
    }

    .apt-student-header .apt-student-login-inline {
        display: block;
        margin-left: 0;
        margin-top: 8px;
    }

    .apt-pagination-controls {
        flex-direction: column;
        gap: 10px;
    }

    .apt-frontend-controls {
        justify-content: flex-start;
    }
}
