/* Page: Learning (#page-learning) */

/* --- 1. Layout & Background --- */
#page-learning {
    background-color: #F3F4F6;
    /* Soft fallback */
    background-image:
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.15) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(6, 182, 212, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
}

#page-learning .main-content {
    padding-top: 2rem;
    padding-bottom: 4rem;
}

/* --- 2. Floating Pill Tabs --- */
#page-learning .learning-tabs {
    border-bottom: none;
    margin-bottom: 2.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

#page-learning .learning-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#page-learning .learning-tabs .nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

#page-learning .learning-tabs .nav-link.active {
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    font-weight: 600;
    transform: translateY(-1px);
}

#page-learning .learning-tabs .nav-link i {
    font-size: 1.1rem;
}

/* --- 3. Glassmorphism Content Container --- */
#page-learning .guide-content {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    padding: 3.5rem;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 20px 25px -5px rgba(0, 0, 0, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
}

/* Decorative top gradient line */
#page-learning .guide-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0.8;
}

#page-learning .guide-content h2 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1F2937 0%, #4B5563 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    letter-spacing: -0.02em;
}

#page-learning .guide-content h3 {
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #1F2937;
    letter-spacing: -0.01em;
}

#page-learning .guide-content h3::before {
    content: '';
    display: block;
    width: 6px;
    height: 28px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

/* --- 4. Content Cards (Box, Tip, Warning) --- */
.content-box {
    border-radius: 16px;
    padding: 2rem;
    margin: 2.5rem 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
}

.content-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.1);
}

/* Summary Box */
.summary-box {
    background: linear-gradient(135deg, rgba(224, 231, 255, 0.6) 0%, rgba(243, 232, 255, 0.6) 100%);
    border-left: 5px solid var(--primary-color);
}

.summary-box h4 {
    color: var(--primary-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tip Box */
.tip-box {
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.7) 0%, rgba(209, 250, 229, 0.5) 100%);
    border-left: 5px solid #10B981;
}

.tip-box h4 {
    color: #059669;
}

/* Warning Box */
.warning-box {
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.8) 0%, rgba(254, 243, 199, 0.6) 100%);
    border-left: 5px solid #F59E0B;
}

.warning-box h4 {
    color: #D97706;
}

/* Enhanced Readability for Boxes */
.summary-box p,
.summary-box li,
.tip-box p,
.tip-box li,
.warning-box p,
.warning-box li {
    line-height: 1.85;
    margin-bottom: 0.75rem;
}

.summary-box ul,
.tip-box ul,
.warning-box ul,
.summary-box ol,
.tip-box ol,
.warning-box ol {
    margin-bottom: 0.5rem;
}

/* --- 5. Code Terminal Style --- */
#page-learning .code-terminal {
    background: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    margin: 1.5rem 0;
    overflow: hidden;
    font-family: 'Consolas', 'Monaco', monospace;
}

#page-learning .code-terminal-header {
    background: #2d2d2d;
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid #333;
}

#page-learning .terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

#page-learning .terminal-dot.red {
    background: #ff5f56;
}

#page-learning .terminal-dot.yellow {
    background: #ffbd2e;
}

#page-learning .terminal-dot.green {
    background: #27c93f;
}

#page-learning .guide-content pre {
    background: transparent;
    border: none;
    color: #d4d4d4;
    padding: 1.5rem;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    overflow-x: auto;
}

#page-learning .guide-content code {
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Inline code style */
#page-learning .guide-content p code,
#page-learning .guide-content li code {
    background: rgba(31, 41, 55, 0.08);
    color: #E11D48;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
}

/* --- 6. Flow Diagram (Animated) --- */
.flow-diagram-container {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin: 3rem 0;
    text-align: center;
    position: relative;
}

.flow-step-card {
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.flow-step-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.1);
}

.flow-step-card .step-num {
    background: var(--primary-color);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    margin: 0 auto 1rem;
}

.flow-arrow-animated {
    color: #9CA3AF;
    font-size: 1.5rem;
    margin: 1rem 0;
    animation: flowPulse 2s infinite;
}

@keyframes flowPulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
        color: #9CA3AF;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
        color: var(--primary-color);
    }

    100% {
        transform: scale(1);
        opacity: 0.5;
        color: #9CA3AF;
    }
}

/* --- 7. Comparison Layout (Security Tab) --- */
.comparison-card {
    height: 100%;
    border-radius: 20px;
    padding: 2rem;
    transition: transform 0.3s ease;
}

.comparison-card.bad {
    background: #FEF2F2;
    border: 2px solid #FECACA;
}

.comparison-card.good {
    background: #ECFDF5;
    border: 2px solid #A7F3D0;
}

.comparison-card .icon-header {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

/* --- 8. Illustrative Image Styles --- */
.concept-image {
    width: 100%;
    max-width: 600px;
    margin: 2rem auto;
    display: block;
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transition: transform 0.5s ease;
}

.concept-image:hover {
    transform: scale(1.02);
}

/* --- 9. Checklist --- */
.checklist {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 2rem;
    margin: 3rem 0;
}

.checklist h4 {
    color: #475569;
    font-weight: 700;
}

.checklist ul li {
    padding: 1rem;
    padding-left: 3rem;
    position: relative;
    background: white;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.checklist ul li:hover {
    transform: translateX(5px);
}

#page-learning .checklist ul li::before {
    content: '\F26D';
    /* Bootstrap Check Circle Fill */
    font-family: 'bootstrap-icons';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
}

/* --- Tables --- */
#page-learning .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#page-learning .table {
    margin-bottom: 0;
}

#page-learning .table thead th {
    background-color: #F9FAFB;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #E5E7EB;
    padding: 1rem;
}

#page-learning .table tbody td {
    padding: 1rem;
    vertical-align: middle;
    color: var(--text-primary);
    border-bottom: 1px solid #F3F4F6;
}

#page-learning .table-hover tbody tr:hover {
    background-color: #F9FAFB;
}

/* --- List Groups (Box Model) --- */
#page-learning .list-group-item {
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    background: transparent;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#page-learning .list-group-item:hover {
    background-color: #F3F4F6;
}

/* --- Badges --- */
#page-learning .badge {
    padding: 0.5em 0.75em;
    font-weight: 600;
    letter-spacing: 0.025em;
    border-radius: 6px;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    #page-learning .guide-content {
        padding: 1.5rem;
    }

    #page-learning .learning-tabs {
        flex-direction: column;
        width: 100%;
        border-radius: 20px;
    }

    #page-learning .learning-tabs .nav-link {
        width: 100%;
        justify-content: flex-start;
    }
}