/**
 * Dashboard Styles
 * Panel "Moje Kursy"
 */

/* === DASHBOARD CONTAINER === */
.ccs-dashboard {
    width: 100%;
}

@media (max-width: 768px) {
    .ccs-dashboard-container {
        padding: 20px 15px;
    }
}

/* === RECENT LESSONS === */
.ccs-recent-lessons {
    margin-bottom: 48px;
}

.ccs-recent-lessons h2,
.ccs-courses-section h2 {
    font-size: 28px;
    margin-bottom: 24px;
    color: var(--ccs-text);
    font-weight: 600;
}

.ccs-recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

@media (min-width: 769px) {
    .ccs-recent-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .ccs-recent-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.ccs-recent-card {
    background: var(--ccs-card-bg);
    border: 1px solid var(--ccs-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ccs-recent-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ccs-shadow-hover);
}

.ccs-recent-card .recent-thumbnail {
    position: relative;
    background: #f0f0f0;
}

.ccs-recent-card .recent-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.ccs-recent-card .recent-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.ccs-recent-card h3 {
    font-size: 16px;
    margin: 0 0 16px;
    line-height: 1.4;
    min-height: 2.8em; /* Stała wysokość - 2 linie */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ccs-recent-card h3 a {
    color: var(--ccs-text);
    text-decoration: none;
}

.ccs-recent-card h3 a:hover {
    color: var(--ccs-primary);
}

.ccs-recent-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--ccs-text-muted);
    margin-bottom: 16px; /* Odstęp przed przyciskiem */
}

.ccs-recent-meta .recent-date {
    margin-left: auto;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-badge.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-completed::before {
    content: '✓';
}

.status-badge.status-in_progress {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-in_progress::before {
    content: '▶';
}

.ccs-recent-meta .recent-date {
    font-size: 12px;
    padding: 4px 8px;
    background: var(--ccs-background);
    border-radius: 4px;
}

.btn-continue-small {
    display: inline-block;
    background: #877d71;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
    margin-top: 12px; /* Większy odstęp od status badge */
    width: 100%;
    text-align: center;
}

.btn-continue-small:hover {
    background: #357abd;
    color: white;
}

/* === COURSES SECTION === */
.ccs-courses-section {
    margin-top: 0;
}

/* === COURSES GRID === */
.ccs-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 32px;
}

@media (min-width: 1024px) {
    .ccs-courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1400px) {
    .ccs-courses-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ccs-courses-grid {
        grid-template-columns: 1fr;
    }
}

/* === COURSE CARD === */
.ccs-course-card {
    background: var(--ccs-card-bg);
    border: 1px solid var(--ccs-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--ccs-shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.ccs-course-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ccs-shadow-hover);
}

.ccs-course-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ccs-course-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ccs-course-content {
    padding: 24px 24px 20px 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ccs-course-card h3 {
    font-size: 22px;
    margin: 0 0 12px;
    color: var(--ccs-text);
}

.ccs-course-card .description {
    font-size: 14px;
    color: var(--ccs-text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
    height: 5.6em; /* Dokładnie 3.5 linii - stała wysokość */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* === PROGRESS SECTION === */
.ccs-progress-section {
    margin: 24px 0 20px 0;
}

.ccs-progress-bar {
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

.ccs-progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 5px;
    transition: width 1s ease-out;
}

.ccs-progress-section .progress-text {
    font-size: 14px;
    color: var(--ccs-text-muted);
    font-weight: 500;
    margin: 8px 0 0 0;
    height: 1.4em;
}

/* === CONTINUE BUTTON === */
.btn-continue {
    display: inline-block;
    width: 100%;
    background: #877d71;
    color: white;
    padding: 14px 24px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    margin: 20px 0 0 0; /* Stały margines górny dla spójności */
}

.btn-continue:hover {
    background: var(--ccs-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    color: white;
}

/* === PDF (podgląd przez proxy – bez pobierania) === */
.btn-view-pdf {
    display: inline-block;
    width: 100%;
    background: white;
    color: var(--ccs-primary);
    border: 2px solid var(--ccs-primary);
    padding: 12px 24px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    margin-top: 12px;
}

.btn-view-pdf:hover {
    background: var(--ccs-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
}

/* === LESSONS LIST === */
.ccs-course-card .ccs-lessons-list {
    border-top: 1px solid var(--ccs-border);
    padding: 20px 24px 24px;
    /* Lista jest POZA .ccs-course-content, więc nie wpływa na wyrównanie przycisku */
}

.ccs-lessons-list h4 {
    font-size: 16px;
    margin: 0 0 16px;
    color: var(--ccs-text);
}

.ccs-lessons-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lesson-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.3s;
    margin-bottom: 8px;
}

.lesson-item:hover {
    background: var(--ccs-background);
}

.lesson-item .icon {
    font-size: 18px;
    width: 24px;
    min-width: 24px;
    text-align: center;
}

.lesson-item.status-completed .icon {
    color: var(--ccs-success);
}

.lesson-item.status-in_progress .icon {
    color: var(--ccs-warning);
}

.lesson-item.status-not_started .icon {
    color: var(--ccs-muted);
}

.lesson-item a {
    flex-grow: 1;
    color: var(--ccs-text);
    text-decoration: none;
    font-size: 15px;
    line-height: 1.4;
}

.lesson-item a:hover {
    color: var(--ccs-primary);
}

.lesson-item .duration {
    font-size: 13px;
    color: var(--ccs-text-muted);
    min-width: 50px;
    text-align: right;
    font-variant-numeric: tabular-nums; /* Wyrównanie cyfr */
}

/* === EMPTY STATE === */
.ccs-empty-state {
    text-align: center;
    padding: 64px 32px;
}

.ccs-empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.ccs-empty-state h3 {
    font-size: 24px;
    margin: 0 0 12px;
    color: var(--ccs-text);
}

.ccs-empty-state p {
    font-size: 16px;
    color: var(--ccs-text-muted);
    margin-bottom: 24px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .ccs-dashboard-header h1 {
        font-size: 28px;
    }

    .ccs-dashboard-header .subtitle {
        font-size: 16px;
    }

    .ccs-recent-grid {
        grid-template-columns: 1fr;
    }
}

