/* Scratch-like Modal for "Make a Block" */
.custom-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(86, 160, 255, 0.8); /* Blue tint overlay */
    z-index: 9999;
    justify-content: center;
    align-items: center;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.custom-modal-content {
    background: white;
    width: 600px;
    max-width: 90%;
    border-radius: 10px;
    border: 4px solid #e0e0e0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.custom-modal-header {
    background: #40DEFA; 
    color: white;
    padding: 10px 20px;
    font-weight: bold;
    font-size: 1.1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.block-preview-area {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 8px;
    overflow-x: auto;
}

/* Simulated Block Styling */
.sim-block {
    background: #40DEFA;
    padding: 12px 16px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: default;
    box-shadow: 1px 1px 0 rgba(0,0,0,0.2);
    white-space: nowrap;
}

.sim-block input.block-name-input {
    background: rgba(0,0,0,0.1);
    border: 1px solid transparent;
    color: white;
    font-weight: bold;
    font-size: 1em;
    padding: 4px 8px;
    border-radius: 4px;
    outline: none;
    min-width: 80px;
    transition: background 0.2s;
}
.sim-block input.block-name-input:focus {
    background: rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.3);
}
.sim-block input.block-name-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.sim-part-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}

/* Arguments in the block */
.sim-arg {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FF3355; /* Darker pink for args */
    border: 1px solid rgba(0,0,0,0.1);
    padding: 4px 10px;
    font-size: 0.9em;
    position: relative;
    margin: 0 2px;
    min-width: 40px;
    color: white;
}

.sim-arg.text-number {
    border-radius: 12px; /* Pill shape */
}

.sim-arg.boolean {
    border-radius: 4px; 
    transform: skew(-15deg);
}
.sim-arg.boolean span {
    transform: skew(15deg); /* Unskew text */
}

/* Delete button for arguments */
.sim-arg-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 16px;
    height: 16px;
    background: #333;
    color: white;
    border-radius: 50%;
    display: none; /* Hidden by default, shown on hover */
    justify-content: center;
    align-items: center;
    font-size: 10px;
    cursor: pointer;
    z-index: 10;
}
.sim-part-wrapper:hover .sim-arg-delete {
    display: flex;
}

.options-area {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: white;
    border: 2px solid #ccc; /* Darker border for visibility */
    border-radius: 8px;
    padding: 15px;
    width: 120px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Added shadow */
}
.option-btn:hover {
    border-color: #4C97FF;
    background: #E6F0FF; /* More visible hover background */
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 151, 255, 0.3); /* Stronger shadow on hover */
}
.option-btn:active {
    transform: translateY(0);
}

.option-icon {
    width: 60px;
    height: 30px;
    background: #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 0.8em;
    font-weight: bold;
}
.option-icon.text-number {
    background: #59C059; /* Greenish */
    border-radius: 15px;
}
.option-icon.boolean {
    background: #59C059;
    border-radius: 4px;
    transform: skew(-15deg);
}
.option-icon.label {
    background: #40DEFA;
    border-radius: 4px;
}

.option-label {
    font-size: 0.85em;
    color: #555;
    text-align: center;
}

.custom-modal-footer {
    padding: 15px 20px;
    background: #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #e0e0e0;
}

.custom-btn {
    padding: 10px 24px;
    border-radius: 4px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    font-size: 1em;
}
.custom-btn.cancel {
    background: #e0e0e0;
    color: #333;
}
.custom-btn.cancel:hover {
    background: #d0d0d0;
}
.custom-btn.ok {
    background: #4C97FF; /* Blue */
    color: white;
}
.custom-btn.ok:hover {
    background: #3A86EF;
}
