/* Entry Quantum Custom Styles */

/* Modal (playentry.org 기준) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9990;
    background: rgba(0, 0, 0, 0);
}

/* Layout Defaults - Full Width */
#entry-container {
    width: 100%;
}

/* Entry Workspace Placeholder Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

#entry-workspace .text-gray-400 {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Modal Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Button Hover Effects */
button {
    transition: all 0.2s ease;
}

button:active {
    transform: scale(0.98);
}

/* Input Focus Effects */
input:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(79, 134, 236, 0.1);
}

/* Loading Spinner */
.spinner {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #4f86ec;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sprite Selector Modal Styles */
#sprite-selector-modal {
    animation: fadeIn 0.2s ease-out;
}

#sprite-selector-modal > div {
    animation: slideIn 0.3s ease-out;
}

.sprite-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sprite-item:hover {
    border-color: #4f86ec;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 134, 236, 0.1);
}

.sprite-item:active {
    transform: translateY(0);
}

.sprite-item img {
    width: 60px;
    height: 60px;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.sprite-item span {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    text-align: center;
}

#sprite-gallery {
    max-height: 400px;
}

#sprite-gallery::-webkit-scrollbar {
    width: 6px;
}

#sprite-gallery::-webkit-scrollbar-track {
    background: #f9fafb;
}

#sprite-gallery::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 3px;
}

#sprite-gallery::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}

/* EntryJS Workspace Layout Fixes */
/* Force EntryJS to use full container width */
#entry-workspace .entryWorkspace {
    width: 100% !important;
}

/* Ensure block menu has reasonable width */
#entry-workspace .blockMenu {
    min-width: 250px !important;
}

/* Fix playground workspace flex layout */
#entry-workspace .entryPlaygroundWorkspace {
    flex: 1 !important;
    min-width: 0 !important;
}

/* Ensure block coding area has proper dimensions */
#entry-workspace .entryBlocklyWorkspace,
#entry-workspace .blocklyMainBackground {
    width: 100% !important;
}

/* Fix block assembly area width */
#entry-workspace .entryBlocklyDiv {
    flex: 1 !important;
    min-width: 400px !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    #entry-container {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
    }

    #sprite-selector-modal > div {
        width: 90vw;
        margin: 0 1rem;
    }

    #sprite-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Quantum Category Icon */
#entryCategoryquantum {
    background-image: url('../images/quantum.png') !important;
    background-repeat: no-repeat !important;
    background-size: 56px auto !important;
    background-position: 50% 4px !important;
}

.entrySelectedCategory#entryCategoryquantum {
    background-image: url('../images/quantum_on.png') !important;
    background-size: 56px auto !important;
    background-color: #9B59B6 !important;
    border-color: #9B59B6 !important;
    color: #fff !important;
}
