:root {
    --primary-color: #2196F3;
    --secondary-color: #FF9800;
    --success-color: #4CAF50;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

#drop-zones {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.drop-zone {
    width: 150px;
    height: 150px;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
    padding: 10px;
    background: #f5f5f5;
    margin: 10px;
}

.drop-zone h3 {
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    text-align: center;
    background: white;
    padding: 2px 5px;
    margin: 0;
    font-size: 14px;
}

.drop-zone .item {
    position: relative;
    margin: 0;
    width: 130px;
    height: 130px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
    z-index: 1;
    cursor: default;
}

.drop-zone .item img {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
}

.drop-zone .item span {
    margin-top: 5px;
    font-size: 14px;
    text-align: center;
}

.drop-zone.hover {
    border-color: var(--primary-color);
    background-color: rgba(33, 150, 243, 0.1);
}

.drop-zone.invalid {
    border-color: #f44336;
    background-color: rgba(244, 67, 54, 0.1);
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

#items-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.item {
    width: 100px;
    height: 100px;
    border: 1px solid #ccc;
    cursor: move;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    user-select: none;
}

.item img {
    pointer-events: none;
    user-select: none;
}

.item span {
    pointer-events: none;
    user-select: none;
}

.item img {
    max-width: 80px;
    max-height: 80px;
}

.tree-layout {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.tree-main {
    flex: 1;
}

#tree-container {
    margin: 20px 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    min-height: 500px;
}

#tree-items {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
}

#tree-result {
    width: 300px;
    padding: 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
}

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

@keyframes highlight {
    0% { background: #4CAF50; }
    100% { background: #f5f5f5; }
}

.complete-path {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    margin: 10px 0;
    background: #f5f5f5;
    border-radius: 4px;
    animation: fadeIn 0.5s ease-out;
}

.config-number {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 16px;
    min-width: 30px;
}

.complete-path img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.buttons {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
}

button:hover {
    opacity: 0.9;
}

#menus-list {
    margin: 20px 0;
}

#created-menus {
    list-style-type: none;
    padding: 0;
    margin: 10px 0;
}

#created-menus li {
    padding: 8px;
    margin: 5px 0;
    background: #f5f5f5;
    border-radius: 4px;
    border-left: 4px solid var(--primary-color);
}

@keyframes successPulse {
    0% { background: #4CAF50; color: white; transform: scale(1); }
    50% { background: #4CAF50; color: white; transform: scale(1.05); }
    100% { background: transparent; color: #4CAF50; transform: scale(1); }
}

#feedback {
    margin: 20px 0;
    padding: 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

#feedback.success {
    animation: successPulse 1.5s ease-out;
    color: #4CAF50;
}

#feedback.success {
    background-color: var(--success-color);
    color: white;
}

.navigation {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.navigation button {
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.navigation button:hover {
    background-color: #1976D2;
}

.scenarios {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.scenario-card {
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 20px;
    width: 300px;
    cursor: pointer;
    transition: transform 0.2s;
}

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

.scenario-card h2 {
    color: var(--primary-color);
    margin-top: 0;
}

.scenario-card p {
    color: #666;
    margin-bottom: 0;
}
