/* --- General & Typography --- */
.glc-wrapper { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; color: #3c434a; line-height: 1.5; }
.glc-wrapper * { box-sizing: border-box; }

/* --- Buttons --- */
.glc-btn { background: #2271b1; color: white; border: none; padding: 10px 20px; cursor: pointer; border-radius: 4px; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 5px; transition: background 0.2s; font-weight: 500; }
.glc-btn:hover { background: #135e96; color: #fff; }
.glc-btn-secondary { background: #f6f7f7; color: #2271b1; border: 1px solid #2271b1; }
.glc-btn-secondary:hover { background: #f0f0f1; color: #135e96; }
.glc-btn-completed { background: #008a20; cursor: default; }
.glc-btn-small { padding: 4px 10px; font-size: 12px; }

/* --- Training Header --- */
.glc-training-header { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid #c3c4c7; padding: 20px; border-radius: 4px; margin-bottom: 25px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.glc-training-status { font-weight: 600; color: #646970; display: flex; align-items: center; gap: 5px; }

/* --- 2-Column Grid Lists (Course/Lesson/Training) --- */
.glc-list-container { margin-bottom: 30px; border: 1px solid #c3c4c7; border-radius: 4px; overflow: hidden; background: #fff; }
.glc-list-header { background: #f0f0f1; padding: 12px 20px; border-bottom: 1px solid #c3c4c7; font-weight: 700; display: flex; justify-content: space-between; align-items: center; color: #1d2327; }
.glc-list-item { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; border-bottom: 1px solid #f0f0f1; transition: background 0.2s; }
.glc-list-item:last-child { border-bottom: none; }
.glc-list-item:hover { background: #fbfbfb; }

/* Column 1: Main Info */
.glc-col-main { display: flex; align-items: center; gap: 12px; flex-grow: 1; }
.glc-icon { font-size: 20px; color: #a7aaad; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.glc-item-title { font-weight: 600; font-size: 1.05em; text-decoration: none; color: #2271b1; }
.glc-item-title:hover { color: #135e96; text-decoration: underline; }
.glc-item-meta { display: block; font-size: 0.85em; color: #646970; margin-top: 2px; }

/* Column 2: Status/Meta */
.glc-col-meta { min-width: 120px; text-align: right; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; }
.glc-badge { display: inline-block; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.glc-badge.completed { background: #edfaef; color: #008a20; border: 1px solid #008a20; }
.glc-badge.score { background: #f0f6fc; color: #2271b1; border: 1px solid #2271b1; }
.glc-badge.pending { background: #f6f7f7; color: #8c8f94; border: 1px solid #c3c4c7; }

/* --- Unit Navigation --- */
.glc-nav-bar { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 20px; border-top: 1px solid #c3c4c7; }
.glc-nav-link { text-decoration: none; font-weight: 600; color: #646970; display: flex; align-items: center; gap: 5px; }
.glc-nav-link:hover { color: #2271b1; }

/* --- Quiz Styles --- */
.glc-quiz-container { border: 1px solid #c3c4c7; border-radius: 4px; background: #fff; padding: 30px; margin-top: 30px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.glc-quiz-intro { text-align: center; }
.glc-option { border: 2px solid #f0f0f1; padding: 15px; margin-bottom: 10px; cursor: pointer; border-radius: 6px; transition: all 0.2s; }
.glc-option:hover { border-color: #2271b1; background: #f0f6fc; }
.glc-option.selected { border-color: #2271b1; background: #e5f5fa; font-weight: 600; }
.glc-opt-key { font-weight: 700; color: #2271b1; margin-right: 8px; }
.glc-controls { display: flex; gap: 10px; margin-top: 20px; justify-content: center; }

.glc-result-item { margin-bottom: 15px; padding: 15px; border-radius: 4px; border: 1px solid #eee; }
.glc-result-item.glc-correct { border-left: 5px solid #008a20; background: #edfaef; }
.glc-result-item.glc-wrong { border-left: 5px solid #d63638; background: #fcf0f1; }
.glc-score-card { font-size: 1.5em; font-weight: bold; text-align: center; margin-bottom: 30px; padding: 20px; background: #f6f7f7; border-radius: 4px; color: #2271b1; border: 1px solid #c3c4c7; }

/* --- Dashboard V2 (Study Plan) - FIXED --- */
.glc-dashboard-v2 { margin-top: 30px; }

.glc-cycle-section { 
    background: #fff; 
    border: 1px solid #c3c4c7; 
    border-radius: 4px; 
    margin-bottom: 30px; 
    overflow: hidden; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.glc-cycle-header { 
    background: #f0f0f1; 
    border-bottom: 1px solid #c3c4c7; 
    padding: 12px 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.glc-cycle-header h3 { 
    margin: 0; 
    font-size: 1.1em; 
    color: #1d2327; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.glc-cycle-header .glc-badge { 
    background: #2271b1; 
    color: #fff; 
    border: none; 
    font-size: 10px; 
    padding: 2px 8px; 
}

.glc-cycle-form { 
    padding: 20px; 
}

/* Table Styling */
.glc-cycle-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-bottom: 20px; 
}

.glc-cycle-table th { 
    text-align: left; 
    font-size: 13px; 
    color: #646970; 
    border-bottom: 2px solid #f0f0f1; 
    padding: 8px; 
    text-transform: uppercase; 
}

.glc-cycle-table td { 
    padding: 10px 8px; 
    border-bottom: 1px solid #f0f0f1; 
    vertical-align: middle; 
}

.glc-cycle-table tr:last-child td { 
    border-bottom: none; 
}

/* Form Inputs within Table */
.glc-course-select, 
.glc-cycle-table input[type="number"] {
    width: 100%;
    padding: 0 8px;
    height: 36px;
    line-height: 2;
    font-size: 14px;
    color: #2c3338;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background-color: #fff;
    box-shadow: 0 0 0 transparent;
    transition: box-shadow .1s linear;
}

.glc-course-select:focus,
.glc-cycle-table input[type="number"]:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: 2px solid transparent;
}

/* Progress Cell */
.glc-progress-cell { width: 25%; min-width: 150px; }
.glc-progress-cell div:first-child { font-size: 12px; color: #646970; margin-bottom: 4px; font-weight: 600; }
.glc-progress-cell div:last-child { border-radius: 3px; overflow: hidden; }

/* Action Buttons */
.glc-actions-cell { white-space: nowrap; text-align: center; width: 100px; }
.glc-actions-cell button { 
    background: transparent; 
    border: 1px solid #c3c4c7; 
    color: #50575e; 
    width: 28px; 
    height: 28px; 
    border-radius: 4px; 
    cursor: pointer; 
    margin: 0 2px; 
    padding: 0;
    line-height: 1;
    font-size: 16px;
}
.glc-actions-cell button:hover { background: #f0f0f1; color: #2271b1; border-color: #2271b1; }
.glc-actions-cell button.glc-remove-row:hover { color: #d63638; border-color: #d63638; background: #fcf0f1; }

/* Link Cell */
.glc-link-cell { width: 50px; text-align: center; }
.glc-link-cell a { text-decoration: none; font-size: 18px; color: #2271b1; }
.glc-link-cell a:hover { color: #135e96; transform: translateX(2px); display: inline-block; }

/* Footer */
.glc-form-footer { display: flex; gap: 10px; margin-top: 10px; padding-top: 15px; border-top: 1px solid #f0f0f1; }

/* --- Idle Popup --- */
#glc-idle-popup { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.8); z-index: 10000; display: none; align-items: center; justify-content: center; }
.glc-idle-box { background: white; padding: 30px; text-align: center; border-radius: 8px; box-shadow: 0 0 20px rgba(0,0,0,0.5); width: 90%; max-width: 400px; }
.glc-idle-box h3 { margin-top: 0; color: #2271b1; }

/* --- Responsive --- */
@media (max-width: 600px) {
    .glc-training-header { flex-direction: column; text-align: center; gap: 15px; }
    .glc-list-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .glc-col-meta { align-items: flex-start; text-align: left; width: 100%; padding-left: 32px; }
    
    /* Responsive Table for Dashboard */
    .glc-cycle-table thead { display: none; }
    .glc-cycle-table tr { display: block; border: 1px solid #ddd; margin-bottom: 10px; border-radius: 4px; padding: 10px; background: #fff; }
    .glc-cycle-table td { display: block; text-align: right; border-bottom: none; padding: 5px 0; }
    .glc-cycle-table td::before { content: attr(data-label); float: left; font-weight: bold; color: #646970; }
    .glc-course-select, .glc-cycle-table input[type="number"] { width: 100%; }
    .glc-progress-cell { width: 100%; }
}