/* Certification Page Specific Styles */
.cert-container {
    padding: 60px 0 100px;
    position: relative;
    z-index: 1;
}

/* Background Accent Shapes */
.cert-bg-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.cert-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.05;
}

.cert-shape-1 {
    top: 10%;
    left: 5%;
    width: 300px;
    height: 300px;
    background: var(--primary-color);
}

.cert-shape-2 {
    top: 50%;
    right: 5%;
    width: 400px;
    height: 400px;
    background: var(--secondary-color);
}

/* Page Header Refinement */
.cert-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 50px;
    gap: 20px;
    flex-wrap: wrap;
}

.cert-title-area {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cert-icon {
    background: var(--primary-color);
    background: var(--primary-gradient);
    color: white;
    padding: 16px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(13, 59, 45, 0.2);
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: floatIcon 3s ease-in-out infinite alternate;
}

@keyframes floatIcon {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-5px) rotate(3deg); }
}

.cert-text h1 {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 5px;
    letter-spacing: -0.5px;
    font-family: 'Noto Sans TC', sans-serif;
}

.cert-text p {
    font-size: 14px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* Toggle Controllers Section */
.controls-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

/* Elegant Segmented Pill Selector */
.segmented-control {
    background: rgba(13, 59, 45, 0.04);
    border: 1px solid rgba(13, 59, 45, 0.08);
    padding: 6px;
    border-radius: 40px;
    display: inline-flex;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.segmented-control button {
    background: transparent;
    border: none;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 700;
    color: #5d6d7e;
    cursor: pointer;
    border-radius: 30px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.segmented-control button i {
    font-size: 14px;
}

.segmented-control button.active {
    color: white;
    background: var(--primary-color);
    box-shadow: 0 4px 15px rgba(13, 59, 45, 0.15);
}

/* Interactive Dashboard Path Container */
.pathway-card {
    background: #fff;
    border-radius: 32px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    padding: 50px 40px;
    margin-bottom: 50px;
    position: relative;
    overflow: hidden;
}

.pathway-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--primary-color) 100%);
}

/* Horizontal Flowchart (Desktop Only) */
.flowchart-desktop {
    display: block;
    margin-bottom: 50px;
    position: relative;
}

.stepper-svg-container {
    position: absolute;
    top: 50px;
    left: 0;
    width: 100%;
    height: 20px;
    pointer-events: none;
    z-index: 1;
}

.stepper-svg-line {
    width: 100%;
    height: 100%;
}

.pulse-line {
    stroke-dasharray: 8, 8;
    animation: flowPulse 2s linear infinite;
}

@keyframes flowPulse {
    to { stroke-dashoffset: -20px; }
}

.stepper-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    position: relative;
    z-index: 2;
}

.step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.step-node:hover {
    transform: translateY(-5px);
}

.step-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #94a3b8;
    position: relative;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.03);
}

.step-circle::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all 0.5s;
}

.step-node.active .step-circle {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #eef7f4;
    box-shadow: 0 10px 25px rgba(13, 59, 45, 0.1);
    transform: scale(1.08);
}

.step-node.active .step-circle::after {
    border-color: rgba(13, 59, 45, 0.2);
    animation: pulseBorder 2s infinite;
}

.step-node.completed .step-circle {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.step-node.completed .step-circle::after {
    border-color: rgba(13, 59, 45, 0.1);
}

@keyframes pulseBorder {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.15); opacity: 0; }
}

.step-badge {
    position: absolute;
    bottom: -8px;
    background: #cbd5e1;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    transition: all 0.3s;
}

.step-node.active .step-badge {
    background: var(--secondary-color);
    color: white;
}

.step-node.completed .step-badge {
    background: var(--primary-light);
    color: white;
}

.step-circle i {
    transition: transform 0.4s;
}

.step-node:hover .step-circle i {
    transform: scale(1.15) rotate(5deg);
}

.step-info {
    margin-top: 25px;
}

.step-info h3 {
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
    transition: color 0.3s;
}

.step-node.active .step-info h3 {
    color: var(--primary-color);
}

.step-info p {
    font-size: 13.5px;
    color: #64748b;
    max-width: 250px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Step Details Content Display */
.details-display-area {
    margin-top: 40px;
    position: relative;
}

.detail-slide {
    display: none;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.detail-slide.active {
    display: block;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.detail-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    align-items: start;
}

.detail-main {
    background: var(--bg-light);
    border-radius: 24px;
    padding: 35px;
    border: 1px solid rgba(13, 59, 45, 0.05);
}

.detail-main-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 1px dashed rgba(13, 59, 45, 0.1);
    padding-bottom: 15px;
}

.detail-main-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-color);
}

.detail-number-badge {
    background: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
}

.detail-desc {
    font-size: 15.5px;
    color: #2c3e50;
    line-height: 1.8;
    margin-bottom: 30px;
}

.meta-info-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.meta-info-item {
    display: flex;
    gap: 15px;
}

.meta-info-item i {
    color: var(--secondary-color);
    font-size: 18px;
    margin-top: 4px;
    width: 20px;
    text-align: center;
}

.meta-info-text {
    flex: 1;
}

.meta-info-text strong {
    display: block;
    font-size: 14px;
    color: #475569;
    margin-bottom: 2px;
}

.meta-info-text span {
    font-size: 15px;
    color: #1e293b;
    font-weight: 500;
}

/* Interactive Checklist Side Card */
.checklist-card {
    background: #fff;
    border: 1.5px dashed var(--primary-color);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(13, 59, 45, 0.03);
    position: relative;
    overflow: hidden;
}

.checklist-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--primary-color);
}

.checklist-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.checklist-title h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.checklist-progress-bar-bg {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 10px;
    margin-bottom: 25px;
    overflow: hidden;
}

.checklist-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 10px;
    transition: width 0.5s ease;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.3s;
}

.checklist-item:hover {
    background: rgba(13, 59, 45, 0.02);
}

.checklist-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    transition: all 0.3s;
    background: #fff;
    flex-shrink: 0;
}

.checklist-checkbox i {
    font-size: 11px;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease-in-out;
}

.checklist-item.checked .checklist-checkbox {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checklist-item.checked .checklist-checkbox i {
    opacity: 1;
    transform: scale(1);
}

.checklist-item-text {
    font-size: 14.5px;
    color: #475569;
    font-weight: 600;
    line-height: 1.5;
    transition: all 0.3s;
}

.checklist-item.checked .checklist-item-text {
    color: #cbd5e1;
    text-decoration: line-through;
}

/* Role Selector View (Student vs Admin) */
.role-badge-indicator {
    background: #e0efca;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 30px;
    margin-bottom: 15px;
    display: inline-block;
}

/* FAQ Accordion Section */
.cert-faq-card {
    background: #fff;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    padding: 45px;
    margin-bottom: 50px;
}

.cert-faq-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 35px;
}

.cert-faq-title h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
}

.cert-faq-title .indicator {
    width: 6px;
    height: 24px;
    background: var(--secondary-color);
    border-radius: 10px;
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.faq-node {
    border: 1px solid #f1f5f9;
    border-radius: 18px;
    overflow: hidden;
    background: #f8fafc;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-node:hover {
    border-color: rgba(13, 59, 45, 0.1);
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(13, 59, 45, 0.02);
}

.faq-node.active {
    border-color: rgba(13, 59, 45, 0.1);
    background: #fff;
    box-shadow: 0 15px 30px rgba(13, 59, 45, 0.04);
}

.faq-trigger {
    padding: 22px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 800;
    font-size: 16px;
    color: #1e293b;
    gap: 15px;
    user-select: none;
}

.faq-trigger span {
    flex: 1;
}

.faq-chevron {
    color: #94a3b8;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s;
    font-size: 14px;
}

.faq-node.active .faq-chevron {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.faq-node.active .faq-trigger {
    color: var(--primary-color);
}

.faq-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-content {
    padding: 0 28px 25px 28px;
    color: #475569;
    font-size: 15px;
    line-height: 1.7;
    border-top: 1px dashed #f1f5f9;
    padding-top: 20px;
}

/* Download Resource Cards */
.download-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.download-card {
    background: #fff;
    padding: 30px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 25px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.download-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(13, 59, 45, 0.05);
}

.download-icon {
    width: 60px;
    height: 60px;
    background: #eef7f4;
    color: var(--primary-color);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.download-card:hover .download-icon {
    background: var(--primary-color);
    color: white;
}

.download-info {
    flex: 1;
}

.download-info h4 {
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 5px;
}

.download-info p {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

.btn-download-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 800;
    color: var(--secondary-color);
    transition: color 0.2s;
}

.download-card:hover .btn-download-link {
    color: var(--energy-orange);
}

/* Mobile Vertical Stepper View */
.flowchart-mobile {
    display: none;
    flex-direction: column;
    gap: 30px;
    position: relative;
    padding-left: 20px;
}

.flowchart-mobile::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 45px;
    bottom: 15px;
    width: 4px;
    background: #e2e8f0;
    z-index: 1;
}

.mobile-step-node {
    display: flex;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.mobile-step-circle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #64748b;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    transition: all 0.4s;
}

.mobile-step-node.active .mobile-step-circle {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #eef7f4;
    transform: scale(1.1);
}

.mobile-step-node.completed .mobile-step-circle {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.mobile-step-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 25px;
    flex: 1;
    transition: all 0.3s;
}

.mobile-step-node.active .mobile-step-card {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px rgba(13, 59, 45, 0.05);
}

.mobile-step-card h3 {
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
}

.mobile-step-node.active .mobile-step-card h3 {
    color: var(--primary-color);
}

.mobile-step-card p {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 15px;
}

.mobile-step-meta {
    font-size: 13px;
    border-top: 1px dashed rgba(0,0,0,0.05);
    padding-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-step-meta div {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
}

.mobile-step-meta i {
    color: var(--secondary-color);
    width: 14px;
}

/* Responsive Overrides */
@media (max-width: 991px) {
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .checklist-card {
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    .cert-container {
        padding: 30px 15px 60px;
    }
    
    .cert-header {
        margin-bottom: 30px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .cert-title-area {
        gap: 15px;
    }
    
    .cert-icon {
        padding: 12px;
        font-size: 22px;
        border-radius: 16px;
    }
    
    .cert-text h1 {
        font-size: 1.8rem;
    }
    
    .controls-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        margin-bottom: 30px;
    }
    
    .segmented-control {
        display: flex;
        width: 100%;
    }
    
    .segmented-control button {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .pathway-card {
        padding: 35px 20px;
        border-radius: 24px;
        margin-bottom: 35px;
    }
    
    /* Toggle off desktop timeline, toggle on mobile timeline */
    .flowchart-desktop {
        display: none;
    }
    
    .flowchart-mobile {
        display: flex;
    }
    
    .details-display-area {
        display: none; /* In mobile view, details are embedded in mobile cards */
    }
    
    .download-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .download-card {
        padding: 20px;
        gap: 15px;
        border-radius: 20px;
    }
    
    .download-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
        border-radius: 14px;
    }
    
    .download-info h4 {
        font-size: 15px;
    }
    
    .cert-faq-card {
        padding: 30px 20px;
        border-radius: 24px;
        margin-bottom: 35px;
    }
    
    .cert-faq-title h2 {
        font-size: 20px;
    }
    
    .faq-trigger {
        padding: 18px 20px;
        font-size: 14.5px;
    }
    
    .faq-content {
        padding: 0 20px 20px 20px;
        font-size: 14px;
    }
}
