/* Theory Page Specific Styles */

/* Topic Navigation */
.topic-nav {
    background-color: white;
    padding: 1.5rem 0;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 60px;
    z-index: 100;
}

.topic-nav-grid {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.topic-nav-item {
    padding: 0.6rem 1.2rem;
    background-color: var(--light-color);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
    font-weight: 500;
    font-size: 0.9rem;
}

.topic-nav-item:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Theory Topic */
.theory-topic {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
    overflow: hidden;
    scroll-margin-top: 150px;
}

.theory-topic.completed {
    border-left: 5px solid var(--success-color);
}

.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
}

.topic-header h2 {
    margin: 0;
    font-size: 1.8rem;
}

.topic-content {
    padding: 2rem;
}

.topic-content h3 {
    color: var(--secondary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.topic-content h3:first-child {
    margin-top: 0;
}

.topic-content p {
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Concept Box */
.concept-box {
    background-color: #e7f3ff;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    margin: 1.5rem 0;
}

.concept-box h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.concept-box ul {
    margin-left: 1.5rem;
}

.concept-box ul li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

/* Visual Examples */
.visual-example {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: var(--light-color);
    border-radius: 8px;
}

.visual-example h4 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Array Visual */
.array-visual {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.array-element {
    text-align: center;
}

.element-value {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    border-radius: 5px;
}

.element-index {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-color);
}

/* Linked List Visual */
.linkedlist-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.ll-node {
    display: flex;
    align-items: center;
    background-color: white;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    overflow: hidden;
}

.ll-data {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.ll-pointer {
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.ll-null {
    padding: 0.5rem 1rem;
    background-color: var(--danger-color);
    color: white;
    border-radius: 5px;
    font-weight: bold;
}

/* Stack Visual */
.stack-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.stack-operation {
    text-align: center;
}

.stack-container {
    display: flex;
    flex-direction: column-reverse;
    gap: 0.25rem;
    min-height: 200px;
    justify-content: flex-start;
}

.stack-element {
    width: 80px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 5px;
}

.stack-element.highlight {
    background-color: var(--secondary-color);
    animation: pulse 0.5s ease-in-out;
}

.operation-label {
    margin-top: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.arrow {
    font-size: 2rem;
    color: var(--primary-color);
}

/* Queue Visual */
.queue-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.queue-element {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    border-radius: 5px;
}

.queue-label {
    font-weight: bold;
    color: var(--text-color);
}

/* Code Example */
.code-example {
    margin: 1.5rem 0;
}

.code-example h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.code-example pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    line-height: 1.5;
}

.code-example code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

/* Complexity Table */
.complexity-table {
    margin: 2rem 0;
}

.complexity-table h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.complexity-table table,
.comparison-box table,
.concept-box table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.complexity-table th,
.complexity-table td,
.comparison-box th,
.comparison-box td,
.concept-box th,
.concept-box td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.complexity-table th,
.comparison-box th,
.concept-box th {
    background-color: var(--secondary-color);
    color: white;
    font-weight: 600;
}

.complexity-table tr:last-child td,
.comparison-box tr:last-child td,
.concept-box tr:last-child td {
    border-bottom: none;
}

.complexity-table tr:hover,
.comparison-box tr:hover,
.concept-box tr:hover {
    background-color: var(--light-color);
}

/* Comparison Box */
.comparison-box {
    margin: 2rem 0;
}

.comparison-box h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

/* Important Problems */
.important-problems {
    background-color: #fff3cd;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--warning-color);
    margin: 2rem 0;
}

.important-problems h4 {
    color: #856404;
    margin-bottom: 1rem;
}

.important-problems ul {
    margin-left: 1.5rem;
}

.important-problems ul li {
    margin-bottom: 0.5rem;
    color: #856404;
}

/* Complexity Chart */
.complexity-chart {
    margin: 2rem 0;
}

.complexity-chart h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.complexity-chart table tr.good {
    background-color: #d4edda;
}

.complexity-chart table tr.fair {
    background-color: #fff3cd;
}

.complexity-chart table tr.poor {
    background-color: #f8d7da;
}

/* Tips Box */
.tips-box {
    background-color: #d1ecf1;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #17a2b8;
    margin: 2rem 0;
}

.tips-box h4 {
    color: #0c5460;
    margin-bottom: 1rem;
}

.tips-box ul {
    margin-left: 1.5rem;
}

.tips-box ul li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

/* OOP Pillars */
.oop-pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.pillar-card {
    background-color: var(--light-color);
    padding: 1.5rem;
    border-radius: 10px;
    border-top: 4px solid var(--primary-color);
}

.pillar-card h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.pillar-card p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

.pillar-card .code-example {
    margin-top: 1rem;
}

/* Important Concepts */
.important-concepts {
    background-color: #e7f3ff;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    margin: 2rem 0;
}

.important-concepts h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.important-concepts ul {
    margin-left: 1.5rem;
}

.important-concepts ul li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

/* Quick Reference */
.quick-reference {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem;
    border-radius: 15px;
    margin-top: 3rem;
}

.quick-reference h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.cheat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.cheat-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.cheat-card h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 0.5rem;
}

.cheat-card ul {
    list-style: none;
}

.cheat-card ul li {
    padding: 0.5rem 0;
    font-size: 0.95rem;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .topic-nav-grid {
        gap: 0.5rem;
    }

    .topic-nav-item {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .topic-header h2 {
        font-size: 1.4rem;
    }

    .topic-content {
        padding: 1.5rem;
    }

    .array-visual {
        flex-wrap: wrap;
    }

    .element-value {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }

    .linkedlist-visual {
        flex-direction: column;
        align-items: flex-start;
    }

    .stack-visual {
        flex-direction: column;
    }

    .queue-visual {
        flex-wrap: wrap;
    }

    .oop-pillars {
        grid-template-columns: 1fr;
    }

    .cheat-grid {
        grid-template-columns: 1fr;
    }
}