/* BodmasParser Frontend Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

.container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-section {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.result-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.result-card {
    flex: 1;
    min-width: 300px;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.result-card:hover {
    transform: translateY(-5px);
}

h1, h2 {
    color: #2c3e50;
}

h1 {
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

input[type="text"] {
    width: 80%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
    transition: border 0.3s ease;
}

input[type="text"]:focus {
    border: 1px solid #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

button {
    padding: 12px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

pre {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    overflow: auto;
    max-height: 400px;
    font-family: 'Consolas', monospace;
    font-size: 14px;
}

.tree-visualization {
    width: 100%;
    height: 500px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 20px;
    overflow: hidden;
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.error {
    color: #e74c3c;
    font-weight: bold;
}

.error-details {
    background-color: #fef0f0;
    border-left: 4px solid #e74c3c;
    padding: 10px 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.error-details p {
    margin: 5px 0;
}

.error-details p:first-child {
    font-weight: bold;
}

.success {
    color: #2ecc71;
    font-weight: bold;
}

.example-expressions {
    margin-top: 20px;
    padding: 15px;
    background-color: #eef2f7;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.example-expression {
    display: inline-block;
    padding: 8px 12px;
    background-color: #dfe6e9;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Consolas', monospace;
}

.example-expression:hover {
    background-color: #b2bec3;
    transform: scale(1.05);
}

#debug-info {
    max-height: 100px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 8px;
    border-radius: 4px;
    background-color: #f9f9f9;
    font-family: monospace;
    font-size: 12px;
}

.status-processing {
    color: #3498db;
    font-weight: bold;
}

.status-section {
    margin-top: 10px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 14px;
}

.status-connected {
    color: #2ecc71;
    font-weight: bold;
}

.status-disconnected {
    color: #e74c3c;
    font-weight: bold;
}

/* Animation for tree nodes */
.node circle {
    transition: r 0.3s, fill 0.3s;
}

.node:hover circle {
    r: 12;
}

.node text {
    transition: font-size 0.3s;
}

.node:hover text {
    font-size: 14px;
    font-weight: bold;
}

.link {
    transition: stroke 0.3s, stroke-width 0.3s;
}

.link:hover {
    stroke: #3498db;
    stroke-width: 3;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    input[type="text"] {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .result-card {
        min-width: 100%;
    }
}

/* Tooltip for visualization */
.tooltip {
    position: absolute;
    text-align: center;
    padding: 8px;
    font: 12px sans-serif;
    background: #333;
    color: #fff;
    border: 0px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}
