* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.header {
    background: #2c3e50;
    color: white;
    padding: 2rem;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

.tabs {
    display: flex;
    background: #34495e;
    border-bottom: 3px solid #2980b9;
}

.tab-button {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.tab-button:hover {
    background: #3c5a7a;
}

.tab-button.active {
    background: #2980b9;
    font-weight: 600;
}

.main-content {
    padding: 2rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Protocol Inspector Styles */
.inspector-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    min-height: 600px;
}

.protocol-selector {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

.protocol-selector h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    text-align: center;
}

.protocol-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.protocol-btn {
    padding: 1rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    text-align: center;
}

.protocol-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.protocol-btn.active {
    background: #e74c3c;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.clear-btn {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.clear-btn:hover {
    background: #7f8c8d;
}

/* TCP/IP Visualization */
.tcpip-visualization {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.visualization-header {
    background: #34495e;
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.visualization-header h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

#selected-protocol-display {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* TCP/IP Layers */
.tcpip-layers {
    display: flex;
    flex-direction: column;
}

.tcpip-layer {
    border-bottom: 1px solid #ddd;
}

.tcpip-layer:last-child {
    border-bottom: none;
}

.layer-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-weight: 600;
}

.layer-name {
    font-size: 1.2rem;
}

.layer-number {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.layer-content {
    padding: 1.5rem;
    min-height: 150px;
    display: flex;
    align-items: center;
}

.empty-layer {
    text-align: center;
    color: #6c757d;
    width: 100%;
}

.empty-layer .hint {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* Protocol Content Styles */
.protocol-content {
    width: 100%;
}

.protocol-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.protocol-info h4 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.protocol-description {
    color: #6c757d;
    line-height: 1.5;
}

.protocol-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    min-width: 200px;
}

.meta-item {
    background: #e9ecef;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

/* Fields Display */
.fields-section h5 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.5rem;
}

.field-item {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.field-name {
    color: #6c757d;
    font-weight: 500;
}

.field-value {
    color: #2c3e50;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* Layer-specific colors */
.tcpip-layer.application .layer-header { background: #27ae60; }
.tcpip-layer.transport .layer-header { background: #3498db; }
.tcpip-layer.internet .layer-header { background: #e67e22; }
.tcpip-layer.network .layer-header { background: #9b59b6; }

/* Placeholder sections */
.placeholder {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.placeholder h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .inspector-container {
        grid-template-columns: 1fr;
    }
    
    .protocol-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .protocol-btn {
        flex: 1;
        min-width: 120px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .protocol-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .fields-grid {
        grid-template-columns: 1fr;
    }
}


/* Protocol Categories */
.protocol-category {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.protocol-category:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.category-title {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.protocol-buttons-category {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.protocol-buttons-category .protocol-btn {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Make protocol selector scrollable if needed */
.protocol-selector {
    max-height: 70vh;
    overflow-y: auto;
}

/* Responsive design for categories */
@media (max-width: 768px) {
    .protocol-buttons-category {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-title {
        font-size: 0.9rem;
    }
    
    .protocol-buttons-category .protocol-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.6rem;
    }
}

/* Categorized Answer Pool */
.answer-pool {
    margin-bottom: 2rem;
}

.answer-category {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    width: 100%;
}

.answer-category:last-child {
    margin-bottom: 0;
}

.answer-category h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.answers-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.answer-item {
    padding: 1rem 1.5rem;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: grab;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    text-align: center;
    user-select: none;
}

.answer-item:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.answer-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

/* Remove the .used styles since we're not greying out anymore */
.answer-item.used {
    /* No styling - items remain available */
}

/* Category-specific styling */
.layer-answers .answer-item {
    border-left: 4px solid #3498db;
}

.description-answers .answer-item {
    border-left: 4px solid #27ae60;
}

/* Responsive design for categorized answers */
@media (max-width: 768px) {
    .answers-container {
        grid-template-columns: 1fr;
    }
    
    .answer-category {
        padding: 0.75rem;
    }
}

.basic-btn{
    padding: 15px;
    color: white;
    background-color: lightseagreen;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}