* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 50px rgba(0,0,0,0.1);
}

header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.navigation {
    background: #f8f9fa;
    padding: 1rem 2rem;
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    border-bottom: 2px solid #e9ecef;
}

.nav-btn {
    background: white;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 600;
}

.nav-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.nav-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.content-section {
    display: none;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

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

.content-section h2 {
    font-size: 2em;
    margin-bottom: 2rem;
    color: #2c3e50;
    border-bottom: 3px solid #667eea;
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* Overview Section */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 3em;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5em;
}

.stats-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
}

.stats-panel h3 {
    margin-bottom: 2rem;
    font-size: 1.8em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* SOLID Section */
.solid-principles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.principle-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.principle-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.1);
}

.principle-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.principle-letter {
    width: 50px;
    height: 50px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5em;
}

.principle-card h3 {
    color: #2c3e50;
    font-size: 1.3em;
}

.code-example {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    border-left: 4px solid #667eea;
}

.code-example code {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9em;
    color: #2c3e50;
}

.solid-animation {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
}

.animation-container {
    margin-top: 2rem;
}

.dependency-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.flow-node {
    background: white;
    border: 2px solid #e9ecef;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.5s ease;
}

.flow-node.abstraction {
    border-color: #28a745;
    color: #28a745;
}

.flow-node.concrete {
    border-color: #667eea;
    color: #667eea;
}

.flow-node.service {
    border-color: #fd7e14;
    color: #fd7e14;
}

.flow-arrow {
    font-size: 2em;
    color: #667eea;
    font-weight: bold;
}

.animate-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.animate-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

/* Architecture Section */
.architecture-diagram {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.arch-layer {
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.arch-layer:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.core-layer {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.models-layer {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.services-layer {
    background: linear-gradient(135deg, #fd7e14 0%, #e55a11 100%);
    color: white;
}

.infrastructure-layer {
    background: linear-gradient(135deg, #6f42c1 0%, #563d7c 100%);
    color: white;
}

.arch-layer h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5em;
}

.layer-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.layer-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9em;
}

.dependency-rules {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
}

.dependency-rules h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.rules-list {
    display: grid;
    gap: 1rem;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    font-weight: 600;
}

.rule-icon {
    font-size: 1.2em;
}

/* Patterns Section */
.patterns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.pattern-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.pattern-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.1);
}

.pattern-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3em;
}

.pattern-description p {
    margin-bottom: 1rem;
    color: #666;
}

.pattern-code {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    overflow-x: auto;
    word-wrap: break-word;
}

.pattern-code code {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.75em;
    color: #2c3e50;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Message Flow Section */
.flow-controls {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.flow-controls select {
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
}

.flow-controls button {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.flow-controls button:hover {
    background: #5a6fd8;
}

.message-flow-diagram {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.flow-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 400px;
}

.compact-step {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    text-align: center;
    transition: all 0.5s ease;
    min-width: 120px;
}

.compact-step.active {
    border-color: #667eea;
    background: #e7f3ff;
    transform: scale(1.05);
}

.step-icon {
    font-size: 1.5em;
    margin-bottom: 0.3rem;
}

.step-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9em;
}

.compact-message {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.5s ease;
    margin: 0.3rem 0;
}

.compact-message.active {
    opacity: 1;
    transform: translateY(0);
}

.flow-split {
    display: flex;
    gap: 2rem;
    margin: 1rem 0;
    justify-content: center;
}

.services-row {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.service-column {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Flow Arrows */
.flow-arrow {
    font-size: 1.5em;
    color: #667eea;
    font-weight: bold;
    text-align: center;
    margin: 0.2rem 0;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.5s ease;
}

.flow-arrow.active {
    opacity: 1;
    transform: translateY(0);
    animation: bounce 0.8s ease-in-out;
}

.split-arrow {
    font-size: 1.8em;
    color: #667eea;
    font-weight: bold;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.5s ease;
}

.split-arrow.active {
    opacity: 1;
    transform: translateY(0);
    animation: bounce 1s ease-in-out;
}

.split-arrow:nth-child(1).active {
    animation-delay: 0.1s;
}

.split-arrow:nth-child(2).active {
    animation-delay: 0.2s;
}

.split-arrow:nth-child(3).active {
    animation-delay: 0.3s;
}

/* Arrow animations */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.flow-details {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
}

.flow-details h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

#flowLog {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    min-height: 150px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9em;
    line-height: 1.4;
    overflow-y: auto;
}

/* Code Section */
.code-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.code-tab {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.code-tab:hover {
    background: #e9ecef;
}

.code-tab.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.code-panels {
    position: relative;
}

.code-panel {
    display: none;
}

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

.code-panel h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3em;
}

.code-panel pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 2rem;
    border-radius: 10px;
    overflow-x: auto;
    border-left: 4px solid #667eea;
}

.code-panel code {
    font-family: 'Monaco', 'Menlo', 'SF Mono', 'Consolas', monospace;
    font-size: 0.9em;
    line-height: 1.5;
}

/* Override highlight.js theme to match our design */
.code-panel pre code.hljs {
    background: transparent;
    padding: 0;
}

/* Custom syntax highlighting colors that work with our theme */
.code-panel .hljs-keyword {
    color: #c792ea;
    font-weight: bold;
}

.code-panel .hljs-string {
    color: #a3f7bf;
}

.code-panel .hljs-comment {
    color: #637777;
    font-style: italic;
}

.code-panel .hljs-function {
    color: #82aaff;
}

.code-panel .hljs-class {
    color: #ffcb6b;
}

.code-panel .hljs-variable {
    color: #ecc48d;
}

.code-panel .hljs-number {
    color: #f78c6c;
}

.code-panel .hljs-built_in {
    color: #82aaff;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.2em;
    color: #667eea;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navigation {
        flex-direction: column;
        gap: 0.5rem;
    }

    .content-section {
        padding: 1rem;
    }

    .feature-grid,
    .solid-principles,
    .architecture-diagram,
    .patterns-grid {
        grid-template-columns: 1fr;
    }

    .dependency-flow {
        flex-direction: column;
        gap: 1rem;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animation Classes */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-slide-in {
    animation: slideIn 0.8s ease-out;
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}