/* Solution Page Specific Styles */

/* Floating Navigation Widget */
.floating-nav {
    position: fixed;
    top: 100px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 80px;
    transition: all 0.3s ease;
}

.floating-nav-header {
    background: linear-gradient(135deg, #5B8DBE, #4A7BA7);
    color: white;
    padding: 12px 15px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.floating-nav-header span {
    font-weight: 600;
    font-size: 14px;
}

.toggle-nav {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    transition: transform 0.3s ease;
}

.toggle-nav.collapsed {
    transform: rotate(-90deg);
}

.floating-nav-content {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.floating-nav-content.hidden {
    display: none;
}

.floating-nav .nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #F8F9FA;
    color: #5B8DBE;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.floating-nav .nav-item:hover {
    background: linear-gradient(135deg, #5B8DBE, #4A7BA7);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(91, 141, 190, 0.3);
}

.floating-nav .nav-item.active {
    background: linear-gradient(135deg, #F89820, #E67E00);
    color: white;
    border-color: #F89820;
}

/* Scroll to top button in floating nav */
.scroll-to-top {
    margin-top: 10px;
    padding: 10px;
    background: #F89820;
    color: white;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.scroll-to-top:hover {
    background: #E67E00;
    transform: translateY(-2px);
}

.question-header {
    background: linear-gradient(135deg, #5B8DBE, #4A7BA7);
    color: white;
    padding: 20px 30px;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
}

.question-header h2 {
    color: white;
    margin: 0;
    font-size: 24px;
}

.question-box {
    background: #F8F9FA;
    padding: 30px;
    border-left: 4px solid #5B8DBE;
    margin-bottom: 20px;
}

.question-box h3 {
    color: #5B8DBE;
    margin-bottom: 15px;
    font-size: 20px;
}

.options-display {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.options-display p {
    margin: 8px 0;
    color: #2C3E50;
    line-height: 1.8;
}

.answer-box {
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 5px solid;
}

.correct-answer {
    background: #D4EDDA;
    border-color: #28A745;
}

.correct-answer h3 {
    color: #28A745;
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.explanation-box {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.explanation-box h3 {
    color: #5B8DBE;
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 600;
}

.explanation-box h4 {
    color: #2C3E50;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 18px;
    border-left: 3px solid #F89820;
    padding-left: 12px;
    font-weight: 600;
}

.explanation-box ol,
.explanation-box ul {
    margin-left: 25px;
    margin-bottom: 20px;
    line-height: 1.8;
}

.explanation-box li {
    margin-bottom: 12px;
    color: #2C3E50;
}

.explanation-box li code {
    background: #F8F9FA;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #D63384;
    font-size: 14px;
}

.explanation-box strong {
    color: #2C3E50;
    font-weight: 600;
}

.explanation-box p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.key-concept {
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    padding: 25px;
    border-radius: 10px;
    margin-top: 30px;
    border-left: 4px solid #5B8DBE;
}

.key-concept h4 {
    color: #5B8DBE;
    margin-bottom: 15px;
    margin-top: 0;
    font-size: 18px;
    border: none;
    padding: 0;
    font-weight: 600;
}

.key-concept p {
    color: #2C3E50;
    line-height: 1.8;
    margin-bottom: 15px;
}

.key-concept ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.key-concept li {
    margin-bottom: 8px;
    color: #2C3E50;
}

.key-concept .code-box {
    margin-top: 15px;
}

/* Table Styling */
.explanation-box table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.explanation-box table th {
    background: #5B8DBE;
    color: white;
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
    font-weight: 600;
}

.explanation-box table td {
    padding: 12px;
    border: 1px solid #ddd;
    color: #2C3E50;
}

.explanation-box table tr:nth-child(even) {
    background: #F8F9FA;
}

.explanation-box table td:nth-child(2),
.explanation-box table td:nth-child(3) {
    text-align: center;
}

/* Responsive Design for Solution Page */
@media (max-width: 768px) {

    /* Floating nav adjustments for mobile */
    .floating-nav {
        top: 70px;
        right: 10px;
        min-width: 60px;
    }

    .floating-nav-header {
        padding: 10px 12px;
    }

    .floating-nav-header span {
        font-size: 12px;
    }

    .floating-nav-content {
        padding: 10px;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .floating-nav .nav-item {
        padding: 8px;
        font-size: 12px;
    }

    .question-header {
        padding: 15px 20px;
    }

    .question-header h2 {
        font-size: 18px;
    }

    .question-box,
    .explanation-box {
        padding: 20px;
    }

    .answer-box {
        padding: 15px 20px;
    }

    .correct-answer h3 {
        font-size: 18px;
    }

    .explanation-box h3 {
        font-size: 20px;
    }

    .explanation-box h4 {
        font-size: 16px;
    }

    .explanation-box table {
        font-size: 12px;
    }

    .explanation-box table th,
    .explanation-box table td {
        padding: 8px;
    }

    .key-concept {
        padding: 20px;
    }
}