/* ==================== LINEAR PAGE STYLES ==================== */

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.page-header p {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* Quick Navigation */
.quick-nav {
    background: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 60px;
    z-index: 100;
}

.quick-nav-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.quick-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--light-bg);
    border: 2px solid var(--light-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    font-weight: 600;
}

.quick-nav-item:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Data Structure Section */
.data-structure-section {
    padding: 3rem 0;
    border-bottom: 1px solid var(--light-border);
}

.data-structure-section:nth-child(even) {
    background: var(--light-bg);
}

.ds-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.ds-title-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ds-title-area i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.ds-title-area h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin: 0;
}

.complexity-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
}

.badge-success {
    background: var(--secondary-color);
}

.badge-warning {
    background: var(--accent-color);
}

.badge-danger {
    background: var(--danger-color);
}

/* DS Content */
.ds-content {
    display: grid;
    gap: 2rem;
}

.ds-description {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.ds-description h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.ds-description h4 {
    color: var(--text-primary);
    margin: 1.5rem 0 1rem;
    font-size: 1.25rem;
}

.ds-description p {
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.feature-list,
.example-list {
    list-style: none;
    padding: 0;
}

.feature-list li,
.example-list li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.feature-list i {
    font-size: 1.25rem;
}

.feature-list .fa-check {
    color: var(--secondary-color);
}

.feature-list .fa-times {
    color: var(--danger-color);
}

.example-list i {
    color: var(--primary-color);
    font-size: 1.25rem;
}

/* Interactive Demo */
.interactive-demo {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.interactive-demo h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.demo-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.demo-controls input {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem;
    border: 2px solid var(--light-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color var(--transition-base);
}

.demo-controls input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.demo-controls .btn {
    padding: 0.75rem 1.5rem;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.visualization-area {
    min-height: 200px;
    background: var(--light-bg);
    border: 2px dashed var(--light-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.array-item,
.list-item {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.3s ease;
    transition: all var(--transition-base);
}

.array-item:hover,
.list-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.array-item .index,
.list-item .index {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.array-item.highlight {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    animation: pulse 0.5s ease;
}

/* Stack Visualization */
.stack-visual {
    flex-direction: column-reverse;
    align-items: center;
    justify-content: flex-start;
    min-height: 300px;
}

.stack-item {
    width: 200px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: var(--shadow-md);
    animation: slideDown 0.3s ease;
    margin: 0.25rem 0;
}

/* Queue Visualization */
.queue-visual {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
}

.queue-item {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: var(--shadow-md);
    animation: slideRight 0.3s ease;
    position: relative;
}

.queue-item::after {
    content: '→';
    position: absolute;
    right: -25px;
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.queue-item:last-child::after {
    display: none;
}

.queue-item.front {
    border: 3px solid var(--secondary-color);
}

.queue-item.rear {
    border: 3px solid var(--accent-color);
}

/* LinkedList Visualization */
.linkedlist-visual {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
}

.linkedlist-node {
    display: flex;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.node-box {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: var(--shadow-md);
    position: relative;
}

.node-arrow {
    width: 40px;
    height: 3px;
    background: var(--text-secondary);
    position: relative;
    margin: 0 0.5rem;
}

.node-arrow::after {
    content: '▶';
    position: absolute;
    right: -10px;
    top: -8px;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Info Panel */
.info-panel {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

.info-panel p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.info-panel strong {
    color: var(--text-primary);
}

/* Code Example */
.code-example {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.code-example h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.code-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--light-border);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.code-content {
    display: none;
}

.code-content.active {
    display: block;
}

.code-content pre {
    margin: 0;
    background: #2d2d2d !important;
    border-radius: var(--radius-md);
    padding: 1.5rem !important;
    overflow-x: auto;
}

.code-content code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Comparison Section */
.comparison-section {
    padding: 3rem 0;
    background: white;
}

.comparison-table-wrapper {
    overflow-x: auto;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.comparison-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--light-border);
}

.comparison-table th {
    font-weight: 700;
    font-size: 0.95rem;
}

.comparison-table tbody tr {
    transition: background var(--transition-base);
}

.comparison-table tbody tr:hover {
    background: var(--light-bg);
}

.comparison-table td:first-child {
    font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }
    
    .ds-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .demo-controls {
        flex-direction: column;
    }
    
    .demo-controls input,
    .demo-controls button {
        width: 100%;
    }
    
    .array-item,
    .list-item,
    .queue-item {
        width: 60px;
        height: 60px;
        font-size: 1rem;
    }
    
    .stack-item {
        width: 150px;
        height: 50px;
    }
    
    .comparison-table {
        font-size: 0.875rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem 0.5rem;
    }
}