/* Component Styles */

/* Enhanced Code Blocks and Syntax Highlighting */
.code-block {
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
    color: #d4d4d4;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    margin: 1.5rem 0;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-block-header {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-block-title {
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.code-block-title::before {
    content: "📄";
    font-size: 1rem;
}

.code-block[data-language="json"] .code-block-title::before {
    content: "{ }";
    font-family: 'Fira Code', monospace;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.code-block[data-language="javascript"] .code-block-title::before {
    content: "JS";
    background: #f7df1e;
    color: #000;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
}

.code-block[data-language="c"] .code-block-title::before,
.code-block[data-language="cpp"] .code-block-title::before,
.code-block[data-language="c++"] .code-block-title::before {
    content: "C++";
    background: #00599c;
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
}

.code-block[data-language="text"] .code-block-title::before {
    content: "📝";
}

.copy-button,
.code-copy-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: transparent !important;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    position: relative;
    /* Completely hide any text content */
    text-indent: -9999px;
    overflow: hidden;
    line-height: 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.copy-button *,
.code-copy-btn * {
    display: none !important;
}

.copy-button:hover,
.code-copy-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.copy-button:active,
.code-copy-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.copy-button.copied,
.code-copy-btn.copied {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border-color: #48bb78;
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(72, 187, 120, 0.4);
}

/* Only CSS content is visible */
.copy-button::before,
.code-copy-btn::before {
    content: "📋 Copy";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    text-indent: 0;
    line-height: normal;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.copy-button.copied::before,
.code-copy-btn.copied::before {
    content: "✅ Copied!";
    animation: copySuccess 0.3s ease-out;
}

/* Copy success animation */
@keyframes copySuccess {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Pulse animation for better visibility */
.copy-button::after,
.code-copy-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.copy-button:hover::after,
.code-copy-btn:hover::after {
    opacity: 1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.2;
    }
}

/* Hide any unwanted copy button pseudo-elements */
button[style*="position: absolute"]::before,
button[style*="top: 0.5rem"]::before,
button[style*="right: 4rem"]::before {
    display: none !important;
    content: none !important;
}

/* Hide buttons with specific absolute positioning */
button[style*="position: absolute"][style*="top: 0.5rem"][style*="right: 4rem"] {
    display: none !important;
}

.code-block-content {
    padding: 1.5rem;
    overflow-x: auto;
    background: #1e1e1e;
}

.code-block pre {
    margin: 0;
    padding: 0;
    background: none;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* JSON Syntax Highlighting */
.json-key {
    color: #9cdcfe;
    font-weight: 500;
}

.json-string {
    color: #ce9178;
}

.json-number {
    color: #b5cea8;
}

.json-boolean {
    color: #569cd6;
    font-weight: 600;
}

.json-null {
    color: #569cd6;
    font-style: italic;
}

.json-punctuation {
    color: #d4d4d4;
}

/* JavaScript Syntax Highlighting */
.js-keyword {
    color: #569cd6;
    font-weight: 600;
}

.js-string {
    color: #ce9178;
}

.js-comment {
    color: #6a9955;
    font-style: italic;
}

.js-number {
    color: #b5cea8;
}

.js-function {
    color: #dcdcaa;
}

.js-operator {
    color: #d4d4d4;
}

/* C/C++ Syntax Highlighting */
.cpp-keyword {
    color: #569cd6;
    font-weight: 600;
}

.cpp-type {
    color: #4ec9b0;
    font-weight: 500;
}

.cpp-string {
    color: #ce9178;
}

.cpp-comment {
    color: #6a9955;
    font-style: italic;
}

.cpp-number {
    color: #b5cea8;
}

.cpp-function {
    color: #dcdcaa;
}

.cpp-operator {
    color: #d4d4d4;
}

.cpp-preprocessor {
    color: #9b9b9b;
    font-style: italic;
}

/* Enhanced Code Block Variants */
.code-block.compact {
    margin: 1rem 0;
}

.code-block.compact .code-block-content {
    padding: 1rem;
}

.code-block.inline-example {
    display: inline-block;
    margin: 0 0.5rem;
    min-width: 200px;
}

/* Topic/Endpoint Display */
.topic-display {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    margin: 1rem 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.topic-label {
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Interactive Code Examples */
.interactive-example {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.example-header {
    background: linear-gradient(90deg, #f7fafc 0%, #edf2f7 100%);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: between;
    align-items: center;
}

.example-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 1rem;
}

.example-tabs {
    display: flex;
    gap: 0.5rem;
}

.example-tab {
    background: #e2e8f0;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a5568;
}

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

.example-content {
    padding: 0;
}

/* Code Block with Line Numbers */
.code-block.with-line-numbers {
    display: grid;
    grid-template-columns: auto 1fr;
}

.line-numbers {
    background: #2d2d2d;
    padding: 1.5rem 0.75rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    color: #6a737d;
    font-size: 0.8rem;
    line-height: 1.6;
    text-align: right;
    user-select: none;
}

.line-numbers span {
    display: block;
}

/* Status and Method Badges */
.method-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 0.5rem;
}

.method-badge.publish {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.method-badge.subscribe {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.method-badge.response {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.method-badge.error {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

/* JSON Tree View */
.json-tree {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.json-tree-node {
    margin-left: 1rem;
}

.json-tree-key {
    color: #9cdcfe;
    cursor: pointer;
}

.json-tree-key:hover {
    text-decoration: underline;
}

.json-tree-expandable::before {
    content: "▶ ";
    color: #6a737d;
    transition: transform 0.2s ease;
}

.json-tree-expandable.expanded::before {
    transform: rotate(90deg);
}

.json-tree-value {
    color: #ce9178;
}

.json-tree-type {
    color: #6a737d;
    font-style: italic;
    font-size: 0.8rem;
}

/* Code Block Animations */
@keyframes slideInCode {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.code-block {
    animation: slideInCode 0.5s ease-out;
}

/* Responsive Design for Code Blocks */
@media (max-width: 768px) {
    .code-block {
        border-radius: 8px;
        margin: 1rem 0;
    }
    
    .code-block-header {
        padding: 0.5rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .code-block-content {
        padding: 1rem;
        font-size: 0.8rem;
    }
    
    .copy-button {
        align-self: flex-end;
    }
    
    .topic-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

.code-inline {
    background: linear-gradient(135deg, #f1f3f4 0%, #e8eaed 100%);
    color: #d73a49;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85em;
    font-weight: 500;
    border: 1px solid rgba(215, 58, 73, 0.2);
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    font-size: 0.9rem;
}

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

.data-table th {
    background: var(--primary-color);
    color: var(--white);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Color Mapping Table */
.color-table {
    margin: 1.5rem 0;
}

.color-table .color-sample {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.color-white { background: #ffffff; }
.color-black { background: #000000; }
.color-red { background: #ff0000; }
.color-yellow { background: #ffff00; }

/* Message Flow Diagrams */
.message-flow {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 2rem 0;
}

.flow-step {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.flow-step:last-child {
    margin-bottom: 0;
}

.flow-number {
    background: var(--primary-color);
    color: var(--white);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 1rem;
    flex-shrink: 0;
}

.flow-content h4 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.flow-content p {
    color: var(--text-light);
    margin: 0;
}

/* Network Topology Diagram */
.topology-diagram {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}

.topology-layer {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem auto;
    max-width: 800px;
}

.topology-layer.layer-server {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8efff 100%);
}

.topology-layer.layer-gateway {
    border-color: #764ba2;
    background: linear-gradient(135deg, #faf0ff 0%, #f0e8ff 100%);
}

.topology-layer.layer-esl {
    border-color: #48bb78;
    background: linear-gradient(135deg, #f0fff4 0%, #e8ffe8 100%);
}

.topology-node {
    display: inline-block;
    background: white;
    border: 2px solid currentColor;
    border-radius: 8px;
    padding: 1rem;
    margin: 0.5rem;
    min-width: 150px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.topology-connection {
    font-size: 1.5rem;
    color: #718096;
    margin: 1rem 0;
    font-weight: 500;
}

/* API Endpoint Cards */
.endpoint-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin: 1rem 0;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.endpoint-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.endpoint-method {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
}

.endpoint-path {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 1.1rem;
}

.endpoint-body {
    padding: 1.5rem;
}

.endpoint-description {
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-indicator.online {
    background: #d6f5d6;
    color: #22543d;
}

.status-indicator.offline {
    background: #fed7d7;
    color: #742a2a;
}

.status-indicator.maintenance {
    background: #fefcbf;
    color: #744210;
}

/* Device Cards */
.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.device-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.device-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.device-card h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.device-specs {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.device-specs p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.device-features {
    margin-top: 1rem;
}

.device-features h4 {
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.device-features ul {
    list-style: none;
    padding: 0;
}

.device-features li {
    padding: 0.25rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.device-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #48bb78;
    font-weight: bold;
}

/* Tabs */
.tabs-container {
    margin: 2rem 0;
}

.tabs-nav {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

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

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

.tab-content {
    display: none;
}

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

/* Alerts and Notifications */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    border-left: 4px solid;
}

.alert-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.alert-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.alert-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-item:not(:last-child)::after {
    content: '›';
    color: var(--border-color);
    font-weight: bold;
}

.breadcrumb-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-link:hover {
    color: var(--secondary-color);
}

/* Search Box */
.search-container {
    position: relative;
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.2rem;
}

/* Responsive adjustments for components */
@media (max-width: 768px) {
    .device-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs-nav {
        flex-wrap: wrap;
    }
    
    .tab-button {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .endpoint-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .topology-layer {
        padding: 1rem;
    }
    
    .topology-node {
        min-width: 100px;
        font-size: 0.8rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .schedule-grid {
        grid-template-columns: 1fr;
    }
    
    .template-preview {
        height: 150px;
    }
}

/* Responsive design for copy buttons */
@media (max-width: 768px) {
    .copy-button,
    .code-copy-btn {
        min-width: 70px;
        padding: 0.5rem 0.8rem;
        font-size: 0;
    }
    
    .copy-button::before,
    .code-copy-btn::before {
        font-size: 0.75rem;
        gap: 0.3rem;
    }
    
    .copy-button:hover,
    .code-copy-btn:hover {
        transform: translateY(-1px);
    }
}

@media (max-width: 480px) {
    .copy-button::before,
    .code-copy-btn::before {
        content: "📋";
        gap: 0;
    }
    
    .copy-button.copied::before,
    .code-copy-btn.copied::before {
        content: "✅";
    }
    
    .copy-button,
    .code-copy-btn {
        min-width: 50px;
        padding: 0.4rem 0.6rem;
    }
}

/* Missing APIs Section */
.missing-api-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.missing-api-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.missing-api-card h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

.api-endpoints {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.endpoint {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    transition: all 0.2s ease;
}

.endpoint:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.endpoint .method {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
    margin-right: 1rem;
}

.endpoint .path {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 1rem;
    flex: 1;
}

.endpoint .description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex: 2;
}

/* Priority Grid */
.priority-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.priority-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 5px solid;
    transition: all 0.3s ease;
}

.priority-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.priority-card.critical {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.05) 0%, var(--bg-color) 50%);
}

.priority-card.high {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.05) 0%, var(--bg-color) 50%);
}

.priority-card.medium {
    border-left-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.05) 0%, var(--bg-color) 50%);
}

.priority-card h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.priority-card.critical h4 {
    color: #dc3545;
}

.priority-card.high h4 {
    color: #ffc107;
}

.priority-card.medium h4 {
    color: #28a745;
}

.priority-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.priority-card ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    padding-left: 1.5rem;
}

.priority-card ul li:last-child {
    border-bottom: none;
}

.priority-card ul li::before {
    content: "•";
    color: var(--accent-color);
    font-weight: bold;
    position: absolute;
    left: 0.5rem;
}

.effort-estimate {
    background: var(--bg-secondary);
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
    margin-top: 1rem;
}

/* Method badges for different HTTP methods */
.endpoint .method[class*="GET"] {
    background: #28a745;
}

.endpoint .method[class*="POST"] {
    background: #007bff;
}

.endpoint .method[class*="PUT"] {
    background: #ffc107;
    color: #000;
}

.endpoint .method[class*="DELETE"] {
    background: #dc3545;
}

.endpoint .method[class*="WebSocket"] {
    background: #6f42c1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .priority-grid {
        grid-template-columns: 1fr;
    }
    
    .endpoint {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .endpoint .method {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

/* Color Mapping Section Styles */
.color-mapping-intro {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.color-mapping-intro p {
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.6;
}

.subsection {
    margin-bottom: 3rem;
}

.subsection h3 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid #667eea;
    padding-bottom: 0.5rem;
}

/* Color Mapping Table */
.color-table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.color-mapping-table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
}

.color-mapping-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.2rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
    border: none;
}

.color-mapping-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.color-mapping-table tr:hover {
    background: #f7fafc;
}

.color-mapping-table tr:last-child td {
    border-bottom: none;
}

.color-mapping-table code {
    background: #f1f5f9;
    color: #667eea;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* Color Sample Visual */
.color-sample {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #cbd5e0;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.color-sample:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.color-sample.white {
    background: #ffffff;
    border-color: #a0aec0;
}

.color-sample.black {
    background: #000000;
    border-color: #4a5568;
}

.color-sample.red {
    background: #e53e3e;
    border-color: #c53030;
}

.color-sample.yellow {
    background: #d69e2e;
    border-color: #b7791f;
}

/* Display Sizes Grid */
.display-sizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.display-size-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.display-size-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.display-size-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.display-size-card.featured {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.display-size-card.featured::before {
    background: rgba(255, 255, 255, 0.3);
}

.display-size-card h4 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
    color: #2d3748;
}

.display-size-card.featured h4 {
    color: white;
}

.size-specs p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.display-size-card.featured .size-specs p {
    color: rgba(255, 255, 255, 0.9);
}

/* Benefits Grid */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.benefit-item {
    background: white;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
}

.benefit-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.benefit-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.benefit-item h4 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.benefit-item p {
    color: #4a5568;
    line-height: 1.6;
    margin: 0;
}

/* Example Layout */
.example-layout {
    background: #f7fafc;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.example-description h4,
.example-code h4 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.example-description ul {
    list-style: none;
    padding: 0;
}

.example-description li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
    padding-left: 1.5rem;
}

.example-description li:last-child {
    border-bottom: none;
}

.example-description li::before {
    content: "▶";
    position: absolute;
    left: 0;
    color: #667eea;
    font-size: 0.8rem;
}

.example-code pre {
    background: #1a202c;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.example-code code {
    color: inherit;
    background: none;
    padding: 0;
}

/* Responsive Design for Color Mapping */
@media (max-width: 768px) {
    .display-sizes-grid,
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .example-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .color-mapping-table {
        font-size: 0.9rem;
    }
    
    .color-mapping-table th,
    .color-mapping-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .color-sample {
        width: 30px;
        height: 30px;
    }
    
    .benefit-item {
        padding: 1.5rem 1rem;
    }
    
    .benefit-icon {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .color-mapping-intro {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .subsection {
        margin-bottom: 2rem;
    }
    
    .color-mapping-table th,
    .color-mapping-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .color-sample {
        width: 25px;
        height: 25px;
    }
    
    .display-size-card,
    .benefit-item {
        padding: 1rem;
    }
    
    .example-layout {
        padding: 1.5rem;
    }
}

/* Storage Requirements Section Styles */
.storage-intro {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.storage-intro p {
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.6;
}

/* Storage Calculation Cards */
.storage-calculation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.calculation-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.calculation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
}

.calculation-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.15);
    border-color: #48bb78;
}

.calculation-card.featured {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border-color: #48bb78;
}

.calculation-card.featured::before {
    background: rgba(255, 255, 255, 0.3);
}

.calculation-card h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #2d3748;
}

.calculation-card.featured h4 {
    color: white;
}

.calc-details p {
    margin: 0.75rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.calculation-card.featured .calc-details p {
    color: rgba(255, 255, 255, 0.95);
}

.highlight {
    background: #ffd93d;
    color: #744210;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

.calculation-card.featured .highlight {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.highlight-large {
    background: #48bb78;
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1.1rem;
}

.calculation-card.featured .highlight-large {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Scenario Grid */
.planning-scenarios h4 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    text-align: center;
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.scenario-card {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.scenario-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-color: #48bb78;
}

.scenario-card h5 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #48bb78;
}

.scenario-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.scenario-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scenario-card li:last-child {
    border-bottom: none;
    font-weight: 600;
    padding-top: 1rem;
    border-top: 2px solid #48bb78;
}

.storage-total {
    background: #ffd93d;
    color: #744210;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.storage-final {
    background: #48bb78;
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
}

/* Optimization Grid */
.optimization-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.optimization-item {
    background: white;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.optimization-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #48bb78;
}

.optimization-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.optimization-item h4 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.optimization-item p {
    color: #4a5568;
    line-height: 1.6;
    margin: 0.75rem 0;
    font-size: 0.95rem;
}

/* Breakdown Table */
.breakdown-example h4 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    text-align: center;
}

.breakdown-table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.breakdown-table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
}

.breakdown-table th {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 1.2rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
    border: none;
}

.breakdown-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.breakdown-table tr:hover {
    background: #f7fafc;
}

.breakdown-table tr:last-child td {
    border-bottom: none;
}

.breakdown-table .total-row {
    background: #f0fff4;
    font-weight: 600;
}

.breakdown-table .total-row:hover {
    background: #e8ffe8;
}

/* Memory Recommendations */
.memory-recommendations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.recommendation-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.recommendation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.recommendation-card.gateway-main::before {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.recommendation-card.gateway-mesh::before {
    background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
}

.recommendation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.recommendation-card.gateway-main:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.recommendation-card.gateway-mesh:hover {
    border-color: #48bb78;
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.15);
}

.recommendation-card h4 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.memory-specs p {
    margin: 0.75rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: left;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.memory-specs p:last-child {
    border-bottom: none;
    padding-bottom: 0;
    font-weight: 600;
    color: #48bb78;
}

/* Responsive Design for Storage Section */
@media (max-width: 768px) {
    .storage-calculation-grid,
    .scenario-grid,
    .optimization-grid,
    .memory-recommendations {
        grid-template-columns: 1fr;
    }
    
    .calculation-card,
    .scenario-card,
    .optimization-item,
    .recommendation-card {
        padding: 1.5rem 1rem;
    }
    
    .optimization-icon {
        font-size: 2.5rem;
    }
    
    .breakdown-table {
        font-size: 0.9rem;
    }
    
    .breakdown-table th,
    .breakdown-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .storage-intro {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .calculation-card,
    .scenario-card,
    .optimization-item,
    .recommendation-card {
        padding: 1rem;
    }
    
    .scenario-card li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .breakdown-table th,
    .breakdown-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .memory-specs p {
        text-align: center;
    }
}

/* Storage Summary Section Styles */
.summary-intro {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.summary-intro p {
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.6;
}

/* Summary Tables */
.summary-table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.summary-table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    font-size: 0.95rem;
}

.summary-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
}

.summary-table td {
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.summary-table tr:hover {
    background: #f7fafc;
}

.summary-table tr:last-child td {
    border-bottom: none;
}

.summary-table .featured-row {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    font-weight: 600;
}

.summary-table .featured-row:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.size-total {
    background: #48bb78;
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.flash-size {
    background: #667eea;
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Calculation Rules */
.calculation-rules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.rule-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.rule-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.rule-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.rule-content h4 {
    color: #2d3748;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.rule-content p {
    color: #4a5568;
    margin: 0;
    line-height: 1.5;
}

/* Optimization Summary */
.optimization-summary {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid #e2e8f0;
}

.optimization-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.optimization-row:last-child {
    border-bottom: none;
}

.optimization-technique {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.optimization-icon {
    font-size: 1.5rem;
}

.optimization-benefit {
    background: #48bb78;
    color: white;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Gateway Recommendations */
.gateway-recommendations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.gateway-recommendation {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gateway-recommendation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.gateway-recommendation:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.gateway-type {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.gateway-icon {
    font-size: 3rem;
}

.gateway-type h4 {
    color: #2d3748;
    margin: 0;
    font-size: 1.3rem;
}

.gateway-specs p {
    margin: 0.75rem 0;
    line-height: 1.6;
    color: #4a5568;
}

.gateway-specs p:first-child {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

.capacity {
    background: #48bb78;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

/* Key Takeaway */
.key-takeaway {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.2);
}

.takeaway-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.takeaway-content h4 {
    color: white;
    margin: 0 0 1rem 0;
    font-size: 1.3rem;
}

.takeaway-content p {
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    line-height: 1.6;
    font-size: 1.05rem;
}

/* Responsive Design for Storage Summary */
@media (max-width: 768px) {
    .calculation-rules,
    .gateway-recommendations {
        grid-template-columns: 1fr;
    }
    
    .rule-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .optimization-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .optimization-technique {
        justify-content: center;
    }
    
    .optimization-benefit {
        align-self: center;
    }
    
    .summary-table {
        font-size: 0.85rem;
    }
    
    .summary-table th,
    .summary-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .key-takeaway {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .summary-intro {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .rule-item,
    .gateway-recommendation {
        padding: 1rem;
    }
    
    .optimization-summary {
        padding: 1rem;
    }
    
    .summary-table th,
    .summary-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .size-total,
    .flash-size,
    .optimization-benefit,
    .capacity {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
    
    .key-takeaway {
        padding: 1.5rem;
    }
    
    .takeaway-icon {
        font-size: 2.5rem;
    }
    
    .gateway-icon,
    .rule-icon {
        font-size: 2rem;
    }
}

/* ESP32 Flash Memory Section Styles */
.flash-intro {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.flash-intro p {
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.6;
}

/* Flash Recommendation Cards */
.flash-recommendation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.flash-recommendation-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.flash-recommendation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.flash-recommendation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.flash-recommendation-card.featured {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-color: #667eea;
    transform: scale(1.02);
}

.flash-recommendation-card.featured::before {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 6px;
}

.flash-brand {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.flash-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.flash-badge.bestseller {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.flash-badge.budget {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.flash-badge.lowpower {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.flash-details h4 {
    color: #2d3748;
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
}

.flash-specs {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.flash-specs p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.flash-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.feature-tag {
    background: #48bb78;
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Gateway Flash Cards */
.gateway-flash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.gateway-flash-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.gateway-flash-card.main-gateway {
    border-color: #667eea;
}

.gateway-flash-card.main-gateway .gateway-flash-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gateway-flash-card.mesh-gateway {
    border-color: #48bb78;
}

.gateway-flash-card.mesh-gateway .gateway-flash-header {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.gateway-flash-header {
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.gateway-flash-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.gateway-flash-header h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.3rem;
}

.gateway-flash-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

.gateway-flash-content {
    padding: 1.5rem;
}

.recommended-flash {
    background: #f0fff4;
    color: #22543d;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
    border-left: 4px solid #48bb78;
}

.flash-capabilities p {
    margin: 0.5rem 0;
    padding-left: 1rem;
    position: relative;
}

.flash-capabilities p::before {
    content: "▶";
    position: absolute;
    left: 0;
    color: #667eea;
    font-size: 0.8rem;
}

/* Compatibility Cards */
.compatibility-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.compatibility-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.compatibility-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.compatibility-header {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.compatibility-header h4 {
    color: #2d3748;
    margin: 0;
    font-size: 1.1rem;
}

.compatibility-details p {
    margin: 0.75rem 0;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Cost Analysis Table */
.cost-table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cost-analysis-table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    font-size: 0.95rem;
}

.cost-analysis-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
}

.cost-analysis-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.cost-analysis-table tr:hover {
    background: #f7fafc;
}

.cost-analysis-table tr:last-child td {
    border-bottom: none;
}

.cost-analysis-table .featured-row {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    font-weight: 600;
}

.cost-analysis-table .featured-row:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.price-tag {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.price-tag.winbond {
    background: #4299e1;
    color: white;
}

.price-tag.gigadevice {
    background: #48bb78;
    color: white;
}

.price-tag.zetta {
    background: #ed8936;
    color: white;
}

/* Supplier Cards */
.suppliers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.supplier-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.supplier-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.supplier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.supplier-header h4 {
    color: #2d3748;
    margin: 0;
    font-size: 1.2rem;
}

.supplier-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.supplier-badge.asia {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.supplier-badge.premium {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.supplier-badge.bulk {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.supplier-details p {
    margin: 0.75rem 0;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Final Recommendations */
.final-recommendations {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
}

.recommendation-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.recommendation-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.recommendation-item.best-overall {
    border-color: #48bb78;
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.05) 0%, white 100%);
}

.recommendation-item.best-budget {
    border-color: #ed8936;
    background: linear-gradient(135deg, rgba(237, 137, 54, 0.05) 0%, white 100%);
}

.recommendation-item.best-prototyping {
    border-color: #4299e1;
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.05) 0%, white 100%);
}

.recommendation-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.recommendation-content h4 {
    color: #2d3748;
    margin: 0 0 0.75rem 0;
    font-size: 1.2rem;
}

.recommendation-content p {
    color: #4a5568;
    margin: 0;
    line-height: 1.6;
}

/* Integration Note */
.integration-note {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.2);
}

.note-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.note-content h4 {
    color: white;
    margin: 0 0 1rem 0;
    font-size: 1.3rem;
}

.note-content p {
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    line-height: 1.6;
    font-size: 1.05rem;
}

/* Responsive Design for Flash Memory Section */
@media (max-width: 768px) {
    .flash-recommendation-grid,
    .gateway-flash-grid,
    .compatibility-grid,
    .suppliers-grid {
        grid-template-columns: 1fr;
    }
    
    .flash-recommendation-card,
    .gateway-flash-card,
    .compatibility-card,
    .supplier-card {
        padding: 1rem;
    }
    
    .flash-recommendation-card.featured {
        transform: none;
    }
    
    .gateway-flash-header {
        padding: 1rem;
    }
    
    .gateway-flash-icon {
        font-size: 2.5rem;
    }
    
    .flash-features {
        justify-content: center;
    }
    
    .recommendation-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .recommendation-icon,
    .note-icon {
        font-size: 2.5rem;
    }
    
    .integration-note {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .cost-analysis-table {
        font-size: 0.85rem;
    }
    
    .cost-analysis-table th,
    .cost-analysis-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .flash-intro {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .flash-recommendation-card,
    .gateway-flash-card,
    .compatibility-card,
    .supplier-card,
    .recommendation-item {
        padding: 1rem;
    }
    
    .gateway-flash-header h4 {
        font-size: 1.1rem;
    }
    
    .flash-details h4 {
        font-size: 1.1rem;
    }
    
    .supplier-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .cost-analysis-table th,
    .cost-analysis-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .price-tag {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
    
    .integration-note {
        padding: 1.5rem;
    }
}

/* Technical Specifications Table */
.tech-table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tech-analysis-table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    font-size: 0.95rem;
}

.tech-analysis-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
}

.tech-analysis-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.tech-analysis-table tr:hover {
    background: #f7fafc;
}

.tech-analysis-table tr:last-child td {
    border-bottom: none;
}

.tech-analysis-table .featured-row {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    font-weight: 600;
}

.tech-analysis-table .featured-row:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

/* ESP-IDF Support Level Indicators */
.support-level {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.support-level.native {
    background: #48bb78;
    color: white;
}

.support-level.compatible {
    background: #4299e1;
    color: white;
}

.support-level.tested {
    background: #ed8936;
    color: white;
}

/* ESP-IDF Configuration Example */
.config-example {
    background: #f7fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.config-example h4 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.config-example .code-block {
    margin: 1rem 0 0 0;
}

.config-example .code-block-content {
    background: #1a202c;
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Update flash recommendation cards for technical focus */
.flash-recommendation-card .flash-specs p {
    margin: 0.4rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.flash-recommendation-card .flash-specs p strong {
    color: #2d3748;
    font-weight: 600;
}

/* ESP32-S3 specific styling */
.gateway-flash-card .gateway-flash-header h4 {
    font-size: 1.2rem;
    margin: 0.25rem 0;
}

.gateway-flash-card .gateway-flash-subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Technical recommendations styling */
.recommendation-item .recommendation-content h4 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #2d3748;
}

.recommendation-item .recommendation-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4a5568;
}

/* Integration note updates */
.integration-note .note-content h4 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.integration-note .note-content p {
    font-size: 1rem;
    line-height: 1.6;
}

/* Responsive design for technical tables */
@media (max-width: 768px) {
    .tech-analysis-table {
        font-size: 0.8rem;
    }
    
    .tech-analysis-table th,
    .tech-analysis-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .support-level {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
    
    .config-example {
        padding: 1rem;
    }
    
    .config-example .code-block-content {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .tech-analysis-table th,
    .tech-analysis-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .support-level {
        font-size: 0.7rem;
        padding: 0.15rem 0.3rem;
    }
    
    .flash-recommendation-card .flash-specs p {
        font-size: 0.8rem;
    }
    
    .config-example .code-block-content {
        font-size: 0.7rem;
        line-height: 1.3;
    }
}

/* Real-World Example Styles */
.product-scenario {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.scenario-header h4 {
    color: white;
    margin: 0 0 1rem 0;
    font-size: 1.3rem;
}

.scenario-details p {
    margin: 0.5rem 0;
    font-size: 1rem;
    line-height: 1.5;
}

.scenario-details strong {
    font-weight: 600;
}

/* Layout Grid */
.layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

/* Visual Layout */
.layout-visual h4 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.visual-mockup {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.layout-section {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

.layout-section:last-child {
    border-bottom: none;
}

.layout-section.red-section {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.layout-section.white-section {
    background: #ffffff;
    color: #2d3748;
    border: 1px solid #e2e8f0;
}

.layout-section.black-section {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
}

.layout-section.yellow-section {
    background: linear-gradient(135deg, #d69e2e 0%, #b7791f 100%);
    color: #1a202c;
}

.section-label {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0.5rem;
}

.layout-section p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Pixel Mapping */
.pixel-mapping {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.pixel-mapping h5 {
    color: #2d3748;
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.pixel-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pixel-row {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    font-size: 0.9rem;
}

.pixel-range {
    font-weight: 600;
    color: #4a5568;
    min-width: 80px;
}

.pixel-color {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
    min-width: 60px;
}

.pixel-color.red {
    background: #e53e3e;
    color: white;
}

.pixel-color.white {
    background: #ffffff;
    color: #2d3748;
    border: 1px solid #e2e8f0;
}

.pixel-color.black {
    background: #2d3748;
    color: white;
}

.pixel-color.yellow {
    background: #d69e2e;
    color: #1a202c;
}

.pixel-desc {
    color: #4a5568;
    font-size: 0.85rem;
}

/* MQTT Payload */
.mqtt-payload h4 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Performance Impact */
.performance-impact {
    background: #f7fafc;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.performance-impact h4 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.3rem;
}

.impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.impact-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.impact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.impact-card.storage {
    border-color: #48bb78;
}

.impact-card.transmission {
    border-color: #4299e1;
}

.impact-card.optimization {
    border-color: #ed8936;
}

.impact-icon {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
}

.impact-card h5 {
    color: #2d3748;
    margin: 0 0 1rem 0;
    text-align: center;
    font-size: 1.1rem;
    border-bottom: 2px solid currentColor;
    padding-bottom: 0.5rem;
}

.impact-card.storage h5 {
    color: #48bb78;
}

.impact-card.transmission h5 {
    color: #4299e1;
}

.impact-card.optimization h5 {
    color: #ed8936;
}

.impact-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.impact-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.impact-card li:last-child {
    border-bottom: none;
}

/* Encoding Breakdown */
.encoding-breakdown {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    border: 2px solid #e2e8f0;
}

.encoding-breakdown h4 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.3rem;
}

.encoding-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.encoding-step {
    background: #f7fafc;
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    border-left: 4px solid #667eea;
}

.step-number {
    position: absolute;
    top: -10px;
    left: -10px;
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.step-content h5 {
    color: #2d3748;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.step-content p {
    color: #4a5568;
    margin: 0.5rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Pixel Distribution */
.pixel-distribution {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.color-count {
    padding: 0.5rem;
    border-radius: 6px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.color-count.white {
    background: #ffffff;
    color: #2d3748;
    border-color: #e2e8f0;
}

.color-count.black {
    background: #2d3748;
    color: white;
}

.color-count.red {
    background: #e53e3e;
    color: white;
}

.color-count.yellow {
    background: #d69e2e;
    color: #1a202c;
}

/* Binary Example */
.binary-example {
    background: #1a202c;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
}

.binary-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.binary-row .pixel {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.binary-row .equals {
    font-size: 1.2rem;
    font-weight: bold;
    color: #48bb78;
}

.binary-row .byte {
    background: #48bb78;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

/* Base64 Sample */
.base64-sample {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #4a5568;
    overflow-x: auto;
}

/* Implementation Notes */
.implementation-notes {
    background: #f7fafc;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.implementation-notes h4 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.3rem;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.note-item {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.note-item h5 {
    color: #2d3748;
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.note-item p {
    color: #4a5568;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Responsive Design for Real-World Example */
@media (max-width: 768px) {
    .layout-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .impact-grid,
    .encoding-steps,
    .pixel-distribution,
    .notes-grid {
        grid-template-columns: 1fr;
    }
    
    .pixel-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }
    
    .binary-row {
        justify-content: center;
    }
    
    .performance-impact,
    .encoding-breakdown,
    .implementation-notes {
        padding: 1.5rem;
    }
    
    .impact-card,
    .encoding-step,
    .note-item {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .product-scenario {
        padding: 1rem;
    }
    
    .layout-section {
        padding: 0.75rem;
    }
    
    .pixel-mapping {
        padding: 0.75rem;
    }
    
    .pixel-breakdown {
        gap: 0.5rem;
    }
    
    .performance-impact,
    .encoding-breakdown,
    .implementation-notes {
        padding: 1rem;
    }
    
    .impact-icon {
        font-size: 2rem;
    }
    
    .step-number {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
    
    .encoding-step {
        padding: 1rem;
    }
    
    .binary-row {
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }
} 