/* Layout Preview Modal Styles */

.layout-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.layout-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.layout-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.layout-modal-content {
    position: relative;
    width: 95%;
    height: 95%;
    max-width: 1400px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s ease-out;
    z-index: 10001;
}

.layout-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    background: linear-gradient(135deg, #6B5DD3 0%, #4A9FE8 100%);
    border-radius: 12px 12px 0 0;
    color: white;
    flex-shrink: 0;
}

.layout-name {
    flex: 1;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.layout-nav-btn {
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.layout-nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.layout-nav-btn:active {
    transform: scale(0.95);
}

.layout-delete-btn {
    background-color: rgba(220, 53, 69, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    margin-left: 15px;
}

.layout-delete-btn:hover {
    background-color: rgba(200, 35, 51, 1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.layout-delete-btn:active {
    transform: scale(0.95);
}

.layout-close-btn {
    background-color: transparent;
    border: none;
    color: white;
    font-size: 3rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    margin-left: 20px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layout-close-btn:hover {
    transform: scale(1.2) rotate(90deg);
    color: #FF6B4A;
}

.layout-preview-iframe {
    flex: 1;
    width: 100%;
    min-height: 600px;
    height: 100%;
    border: none;
    background-color: #f0f0f0;
    border-radius: 0 0 12px 12px;
}

.layout-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #6B5DD3;
    font-size: 1.2rem;
    font-weight: 600;
}

.layout-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Responsive styles */
@media (max-width: 768px) {
    .layout-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .layout-modal-header {
        padding: 15px 15px;
        border-radius: 0;
    }

    .layout-name {
        font-size: 1.1rem;
    }

    .layout-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
    }

    .layout-close-btn {
        font-size: 2.5rem;
        margin-left: 10px;
    }

    .layout-preview-iframe {
        border-radius: 0;
    }
}

/* Keyboard navigation hint */
.keyboard-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10002;
}

.layout-modal.active .keyboard-hint {
    animation: hintFadeInOut 3s ease-in-out;
}

@keyframes hintFadeInOut {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}
