/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* Wiki container */
.wiki-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    padding: 40px;
}

/* Header styles */
.wiki-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 3px solid #00d4ff;
}

.wiki-header h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00d4ff, #0080ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    font-weight: 500;
    margin-bottom: 25px;
}

/* View Switcher */
.view-switcher {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.view-button {
    background: white;
    color: #495057;
    border: 2px solid #dee2e6;
    padding: 14px 32px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.view-button:hover {
    background: #f8f9fa;
    border-color: #00d4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
}

.view-button.active {
    background: linear-gradient(135deg, #00d4ff, #0080ff);
    color: white;
    border-color: #00d4ff;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

/* Back to Diagram Button */
.back-to-diagram-container {
    text-align: center;
    margin-bottom: 25px;
}

.back-to-diagram-button {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.back-to-diagram-button:hover {
    background: linear-gradient(135deg, #495057, #343a40);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108, 117, 125, 0.4);
}

/* Search container */
.search-container {
    margin-bottom: 30px;
}

.search-bar {
    position: relative;
    max-width: 800px;
    margin: 0 auto 15px;
}

.search-input {
    width: 100%;
    padding: 18px 50px 18px 24px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    border-color: #00d4ff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.1);
}

.clear-button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #dc3545;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-button:hover {
    background: #c82333;
    transform: translateY(-50%) scale(1.1);
}

.clear-button.hidden {
    display: none;
}

.search-info {
    text-align: center;
    color: #666;
    font-size: 1rem;
}

/* Category filter */
.category-filter {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.category-filter h3 {
    color: #00d4ff;
    font-size: 1.4rem;
    margin-bottom: 15px;
    text-align: center;
}

.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.category-button {
    background: white;
    color: #495057;
    border: 2px solid #e9ecef;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.category-button:hover {
    background: #e9ecef;
    border-color: #00d4ff;
    transform: translateY(-2px);
}

.category-button.active {
    background: linear-gradient(135deg, #00d4ff, #0080ff);
    color: white;
    border-color: #00d4ff;
}

.reset-button {
    display: block;
    margin: 0 auto;
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.reset-button:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* Concepts container */
.concepts-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.category-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    border-left: 5px solid #00d4ff;
}

.category-title {
    color: #0080ff;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
}

.concepts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 20px;
}

/* Concept card */
.concept-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.concept-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.concept-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.concept-title {
    color: #1a1a2e;
    font-size: 1.2rem;
    font-weight: 600;
    flex: 1;
}

.copy-button {
    background: #00d4ff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-button:hover {
    background: #0080ff;
    transform: scale(1.05);
}

.copy-button.copied {
    background: #28a745;
}

.concept-description {
    color: #444;
    font-size: 0.95rem;
    margin-bottom: 15px;
    padding: 12px;
    background: #e7f8ff;
    border-radius: 6px;
    border-left: 3px solid #00d4ff;
    line-height: 1.6;
}

.concept-description p {
    margin-bottom: 8px;
}

.concept-description ul, .concept-description ol {
    margin-left: 20px;
    margin-bottom: 8px;
}

.concept-description li {
    margin-bottom: 4px;
}

.concept-description strong {
    color: #0080ff;
    font-weight: 600;
}

.concept-description code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

.content-block {
    background: #f8f9fa;
    color: #333;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    border: 1px solid #e9ecef;
}

.content-block p {
    margin-bottom: 12px;
}

.content-block ul, .content-block ol {
    margin-left: 25px;
    margin-bottom: 12px;
}

.content-block li {
    margin-bottom: 6px;
}

.content-block strong {
    color: #0080ff;
    font-weight: 600;
}

.content-block code {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

.content-block pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 10px 0;
}

.content-block pre code {
    background: none;
    padding: 0;
}

.content-block h4 {
    color: #0080ff;
    font-size: 1.1rem;
    margin-top: 15px;
    margin-bottom: 10px;
}

.content-block h5 {
    color: #00d4ff;
    font-size: 1rem;
    margin-top: 12px;
    margin-bottom: 8px;
}

/* No results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results p {
    font-size: 1.3rem;
}

/* No selection state */
.no-selection {
    text-align: center;
    padding: 100px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 2px dashed #00d4ff;
    color: #495057;
}

.no-selection p {
    font-size: 1.5rem;
    font-weight: 600;
    color: #00d4ff;
}

/* Responsive design */
@media (max-width: 1024px) {
    .concepts-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (max-width: 768px) {
    .wiki-container {
        margin: 10px;
        padding: 25px;
    }

    .wiki-header h1 {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .concepts-grid {
        grid-template-columns: 1fr;
    }

    .concept-header {
        flex-direction: column;
        align-items: stretch;
    }

    .copy-button {
        width: 100%;
    }

    .category-buttons {
        gap: 8px;
    }

    .category-button {
        font-size: 0.85rem;
        padding: 8px 14px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .wiki-container {
        padding: 15px;
    }

    .wiki-header h1 {
        font-size: 1.8rem;
    }

    .search-input {
        font-size: 1rem;
        padding: 14px 45px 14px 18px;
    }

    .category-section {
        padding: 20px;
    }

    .category-title {
        font-size: 1.5rem;
    }

    .content-block {
        font-size: 0.85rem;
        padding: 12px;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #00d4ff;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0080ff;
}

/* Diagram Page */
.diagram-page {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 40px;
    border: 2px solid #dee2e6;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    min-height: 1200px;
    overflow-x: auto;
}

.control-plane-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.diagram-section h2 {
    color: #0080ff;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
}

.diagram-instruction {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 25px;
    font-weight: 500;
}

.control-plane-svg {
    width: 100%;
    max-width: none;
    min-width: 1350px;
    min-height: 1050px;
    height: auto;
    margin: 0 auto;
    display: block;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* SVG component styles */
.diagram-title {
    font-size: 48px;
    font-weight: 700;
    fill: #1a1a2e;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.component-group {
    cursor: pointer;
    transition: all 0.3s ease;
}

.component-group:hover rect {
    filter: brightness(1.1);
    stroke-width: 8;
}

.component-group.selected rect {
    stroke: #ffc107;
    stroke-width: 10;
    filter: drop-shadow(0 0 20px rgba(255, 193, 7, 0.6));
}

.component-label {
    font-size: 32px;
    font-weight: 700;
    fill: white;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.component-sublabel {
    font-size: 24px;
    font-weight: 500;
    fill: rgba(255, 255, 255, 0.9);
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.component-label-small {
    font-size: 26px;
    font-weight: 700;
    fill: white;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.section-label {
    font-size: 36px;
    font-weight: 700;
    fill: #1a1a2e;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.node-label {
    font-size: 28px;
    font-weight: 600;
    fill: #f57c00;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.pod-label {
    font-size: 22px;
    font-weight: 600;
    fill: #689f38;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.container-label {
    font-size: 18px;
    font-weight: 600;
    fill: #689f38;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.arrow-label {
    font-size: 22px;
    font-weight: 500;
    fill: #495057;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.legend-title {
    font-size: 28px;
    font-weight: 700;
    fill: #1a1a2e;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.legend-text {
    font-size: 24px;
    font-weight: 500;
    fill: #495057;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

/* Component Info Section */
.component-info-section {
    min-height: 300px;
}

.component-info-placeholder {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.component-info-placeholder p {
    color: #6c757d;
    font-size: 1.2rem;
    font-weight: 500;
}

.component-info-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #326ce5;
    animation: slideIn 0.3s ease;
}

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

.component-info-card h3 {
    color: #326ce5;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.component-description {
    color: #495057;
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding: 15px;
    background: #e7f3ff;
    border-radius: 8px;
    border-left: 4px solid #326ce5;
}

.component-details {
    color: #333;
    line-height: 1.7;
}

.component-details h4 {
    color: #0080ff;
    font-size: 1.2rem;
    margin-top: 20px;
    margin-bottom: 12px;
    font-weight: 600;
}

.component-details ul, .component-details ol {
    margin-left: 25px;
    margin-bottom: 15px;
}

.component-details li {
    margin-bottom: 8px;
    color: #495057;
}

.component-details strong {
    color: #326ce5;
    font-weight: 600;
}

.component-details p {
    margin-bottom: 12px;
    color: #495057;
}

.close-info-button {
    margin-top: 25px;
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.close-info-button:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Responsive adjustments for diagram */
@media (max-width: 768px) {
    .view-switcher {
        flex-direction: column;
        gap: 10px;
    }

    .view-button {
        width: 100%;
        padding: 12px 24px;
        font-size: 1rem;
    }

    .diagram-page {
        padding: 20px;
    }

    .diagram-section h2 {
        font-size: 1.5rem;
    }

    .diagram-instruction {
        font-size: 0.95rem;
    }

    .component-info-card {
        padding: 20px;
    }

    .component-info-card h3 {
        font-size: 1.4rem;
    }

    .component-description {
        font-size: 1rem;
    }

    .diagram-title {
        font-size: 18px;
    }

    .component-label {
        font-size: 13px;
    }

    .component-sublabel {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .diagram-page {
        padding: 15px;
    }

    .control-plane-svg {
        padding: 5px;
    }

    .component-info-card {
        padding: 15px;
    }

    .diagram-title {
        font-size: 16px;
    }

    .component-label {
        font-size: 11px;
    }

    .component-sublabel {
        font-size: 9px;
    }

    .view-button {
        font-size: 0.9rem;
        padding: 10px 20px;
    }
}
