/**
 * Trainingsplan Frontend Styles - Vertical Timeline Design
 * Colors: Green #88b441, Dark Blue #1a243b, Orange #b1632f
 * Based on Course Roadmap Plugin design
 */

/* === CONTAINER === */
.aca-tp-quiz-container,
.aca-tp-path-container {
    max-width: 1140px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* === TIMELINE STRUCTURE === */
#aca-tp-timeline {
    position: relative;
    max-width: 1140px;
    width: 100%;
    margin: 0 auto;
    z-index: 1;
}

/* Vertical center line */
#aca-tp-timeline .timeline-center-line {
    position: absolute;
    width: 14px;
    height: 100%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #f3f3f3;
    z-index: -1;
}

@media only screen and (max-width: 830px) {
    #aca-tp-timeline .timeline-center-line {
        left: 50px;
    }
}

@media only screen and (max-width: 601px) {
    #aca-tp-timeline .timeline-center-line {
        left: 40px;
    }
}

/* === START BUTTON === */
#aca-tp-timeline .timeline-start {
    position: relative;
}

#aca-tp-timeline .timeline-start::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 200px;
    background: #88b441;
    left: 50%;
    transform: translateX(-50%);
    top: 106px;
}

@media only screen and (max-width: 830px) {
    #aca-tp-timeline .timeline-start::after {
        left: 50px;
    }
}

@media only screen and (max-width: 601px) {
    #aca-tp-timeline .timeline-start::after {
        left: 40px;
        top: 80px;
    }
}

#aca-tp-timeline .btn-start {
    background: #88b441;
    border: 10px solid #c0e6a0;
    border-radius: 100px;
    width: 106px;
    height: 106px;
    margin: 0 auto;
    font-weight: 600;
    font-size: 16px;
    line-height: 24px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: capitalize;
    position: relative;
    z-index: 1;
}

@media only screen and (max-width: 830px) {
    #aca-tp-timeline .btn-start {
        margin-left: -2px;
    }
}

@media only screen and (max-width: 601px) {
    #aca-tp-timeline .btn-start {
        width: 80px;
        height: 80px;
        margin-left: 0;
        border-width: 8px;
    }
}

/* === END FLAG === */
#aca-tp-timeline .timeline-end {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    background: #ffffff;
    border: 10px solid #f3f3f3;
    margin: 0 auto;
    border-radius: 100%;
    position: relative;
    z-index: 1;
    font-size: 48px;
}

@media only screen and (max-width: 830px) {
    #aca-tp-timeline .timeline-end {
        margin-left: -2px;
    }
}

@media only screen and (max-width: 601px) {
    #aca-tp-timeline .timeline-end {
        width: 80px;
        height: 80px;
        border-width: 8px;
        font-size: 40px;
    }
}

#aca-tp-timeline .timeline-end.completed {
    background: #88b441;
    border-color: #c0e6a0;
}

/* === TIMELINE CONTENT === */
#aca-tp-timeline .timeline-content {
    padding-top: 200px;
}

@media only screen and (max-width: 601px) {
    #aca-tp-timeline .timeline-content {
        padding-top: 156px;
    }
}

/* === TIMELINE ARTICLE (SINGLE STEP) === */
.timeline-article {
    width: 100%;
    height: 100%;
    position: relative;
    padding-top: 80px;
    min-height: 180px;
}

@media only screen and (max-width: 601px) {
    .timeline-article {
        padding-top: 60px;
    }
}

/* Progress line connecting steps */
.timeline-article::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 100%;
    max-height: 0;
    transition: max-height 0.25s ease-out;
    background: #88b441;
    left: 50%;
    transform: translateX(-50%);
}

@media only screen and (max-width: 830px) {
    .timeline-article::before {
        left: 50px;
    }
}

@media only screen and (max-width: 601px) {
    .timeline-article::before {
        left: 40px;
    }
}

.timeline-article.completed::before {
    max-height: 98%;
    transition: max-height 0.25s ease-in;
}

.timeline-article::after {
    content: "";
    display: block;
    clear: both;
}

/* === NUMBERED CIRCLE === */
.step-number-circle {
    font-weight: 600;
    font-size: 24px;
    line-height: 36px;
    text-align: center;
    color: #1a243b;
    background: #ffffff;
    border: 10px solid #f3f3f3;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    transition: border-color 0.5s ease-out;
    z-index: 10;
}

@media only screen and (max-width: 830px) {
    .step-number-circle {
        left: 50px;
    }
}

@media only screen and (max-width: 601px) {
    .step-number-circle {
        border-width: 5px;
        font-size: 18px;
        width: 60px;
        height: 60px;
        left: 40px;
    }
}

.timeline-article.completed .step-number-circle {
    border-color: #c0e6a0 !important;
}

.timeline-article.next .step-number-circle {
    border-color: #b1632f !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: translateX(-50%) scale(1); 
    }
    50% { 
        opacity: 0.8; 
        transform: translateX(-50%) scale(1.05); 
    }
}

@media only screen and (max-width: 830px) {
    .timeline-article.next .step-number-circle {
        animation: pulse-mobile 2s infinite;
    }
    
    @keyframes pulse-mobile {
        0%, 100% { 
            opacity: 1; 
            transform: translateX(0) scale(1); 
        }
        50% { 
            opacity: 0.8; 
            transform: translateX(0) scale(1.05); 
        }
    }
}

/* === STEP CONTENT BOX === */
.timeline-article-content {
    max-width: 42%;
    width: 100%;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.timeline-article-content:hover {
    transform: translateY(-4px);
}

@media only screen and (max-width: 830px) {
    .timeline-article-content {
        max-width: 100%;
        width: auto;
        float: none !important;
        margin-left: 130px;
        min-height: 53px;
    }
}

@media only screen and (max-width: 601px) {
    .timeline-article-content {
        margin-left: 100px;
    }
}

/* Left/Right alternating */
.timeline-article:nth-child(odd) .timeline-article-content {
    float: right;
}

.timeline-article:nth-child(even) .timeline-article-content {
    float: left;
}

/* === STEP BOX INNER === */
.timeline-article-inner {
    display: grid;
    row-gap: 16px;
    position: relative;
    width: auto;
    padding: 20px;
    z-index: 1;
    background: #ffffff;
    filter: drop-shadow(0px 0px 30px rgba(0, 0, 0, 0.08));
    border-radius: 12px;
    top: -90px;
}

@media only screen and (max-width: 601px) {
    .timeline-article-inner {
        top: -80px;
        padding: 16px;
    }
}

.timeline-article.completed .timeline-article-inner {
    border: 2px solid #88b441;
}

.timeline-article.next .timeline-article-inner {
    border: 3px solid #b1632f;
}

/* === STEP DETAILS === */
.step-details {
    display: grid;
    grid-template-columns: 100px 1fr;
    column-gap: 16px;
}

@media only screen and (max-width: 601px) {
    .step-details {
        grid-template-columns: 1fr;
        row-gap: 12px;
    }
}

.step-photo img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

@media only screen and (max-width: 601px) {
    .step-photo img {
        height: 150px;
    }
}

.step-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.step-info h3 {
    font-weight: 600;
    font-size: 18px;
    line-height: 26px;
    color: #1a243b;
    margin: 0 0 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.step-info p {
    font-weight: normal;
    font-size: 13px;
    line-height: 20px;
    color: #8a9197;
    margin: 0;
}

/* === RATING (BOXES) === */
.step-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 5;
    cursor: help;
}

.rating-box {
    width: 10px;
    height: 10px;
    border: 2px solid #88b441;
    display: inline-block;
    margin: 0 1px;
    border-radius: 2px;
}

.rating-box.filled {
    background: #88b441;
}

/* Orange boxes for next step */
.timeline-article.next .rating-box {
    border-color: #b1632f;
}

.timeline-article.next .rating-box.filled {
    background: #b1632f;
}

.step-rating .rating-tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1a243b;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.step-rating:hover .rating-tooltip {
    display: block;
}

/* === PROGRESS BAR === */
.step-progress {
    font-weight: normal;
    font-size: 12px;
    line-height: 18px;
    color: #8a9197;
}

.step-progressbar {
    max-width: 100%;
    width: 100%;
    height: 6px;
    background: #f3f3f3;
    border-radius: 100px;
    margin-top: 6px;
    display: flex;
}

.step-progressbar-inner {
    display: inline-block;
    height: 6px;
    background: #88b441;
    border-radius: 100px;
    max-width: 100%;
    transition: width 0.5s ease;
}

/* === COMPLETED BADGE === */
.step-completed-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #88b441;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(136, 180, 65, 0.4);
}

/* Manual completion checkbox */
.step-manual-complete {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(136, 180, 65, 0.2);
    border: 2px solid #88b441;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #88b441;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.step-manual-complete:hover {
    background: rgba(136, 180, 65, 0.3);
    transform: scale(1.1);
}

.step-manual-complete.completed {
    background: #88b441;
    color: white;
    box-shadow: 0 2px 8px rgba(136, 180, 65, 0.4);
}

/* === PATH HEADER === */
.aca-tp-path-header {
    text-align: right;
    margin-bottom: 30px;
}

.aca-tp-reset-btn {
    background: #ffffff;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #1a243b;
    transition: all 0.2s ease;
    display: inline-block;
}

.aca-tp-reset-btn:hover {
    background: #88b441;
    border-color: #88b441;
    color: white;
}

/* === QUIZ STYLES === */
.aca-tp-quiz-wrapper {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 40px;
    max-width: 700px;
    margin: 0 auto;
}

.aca-tp-quiz-header {
    text-align: center;
    margin-bottom: 40px;
}

.aca-tp-quiz-header h2 {
    color: #1a243b;
    font-size: 32px;
    margin-bottom: 12px;
}

.aca-tp-quiz-header p {
    color: #666;
    font-size: 16px;
}

.aca-tp-question {
    margin-bottom: 35px;
    padding-bottom: 35px;
    border-bottom: 1px solid #e8e8e8;
}

.aca-tp-question:last-of-type {
    border-bottom: none;
}

.aca-tp-question-label {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #1a243b;
    margin-bottom: 16px;
}

.aca-tp-question-number {
    display: block;
    font-size: 13px;
    color: #88b441;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 700;
}

.aca-tp-question-label small {
    display: block;
    font-size: 13px;
    color: #999;
    font-weight: 400;
    margin-top: 4px;
}

.aca-tp-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aca-tp-option {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aca-tp-option:hover {
    border-color: #88b441;
    background: #f0f8e8;
}

.aca-tp-option input[type="radio"],
.aca-tp-option input[type="checkbox"] {
    margin: 0 12px 0 0;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #88b441;
}

.aca-tp-option input:checked + span {
    font-weight: 600;
    color: #88b441;
}

.aca-tp-option span {
    flex: 1;
    font-size: 15px;
    color: #333;
}

.aca-tp-quiz-actions {
    margin-top: 40px;
    text-align: center;
}

.aca-tp-submit-btn {
    background: #88b441;
    color: white;
    border: none;
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(136, 180, 65, 0.3);
}

.aca-tp-submit-btn:hover {
    background: #76a036;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(136, 180, 65, 0.4);
}

.aca-tp-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

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

/* === MODALS === */
.aca-tp-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aca-tp-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
}

.aca-tp-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 1;
}

.aca-tp-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e8e8e8;
}

.aca-tp-modal-header h3 {
    margin: 0;
    color: #1a243b;
    font-size: 24px;
}

.aca-tp-modal-body {
    padding: 24px;
}

.aca-tp-modal-actions {
    padding: 16px 24px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.aca-tp-btn-primary,
.aca-tp-btn-secondary,
.aca-tp-btn-danger {
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 15px;
}

.aca-tp-btn-primary {
    background: #88b441;
    color: white;
}

.aca-tp-btn-primary:hover {
    background: #76a036;
}

.aca-tp-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.aca-tp-btn-secondary:hover {
    background: #e8e8e8;
}

.aca-tp-btn-danger {
    background: #dc3545;
    color: white;
}

.aca-tp-btn-danger:hover {
    background: #c82333;
}

/* === TOOLTIP === */
.aca-tp-tooltip {
    position: fixed;
    background: #1a243b;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    max-width: 300px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    pointer-events: none;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .aca-tp-quiz-wrapper {
        padding: 24px;
    }
}
