/**
 * Plugin Admin Modal Styles
 * OS/2 Warp themed modal dialogs for plugin configuration
 */

/* Modal Overlay */
.plugin-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 128, 128, 0.3); /* Teal overlay */
    z-index: 9998;
    backdrop-filter: blur(2px);
}

.plugin-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-in;
}

/* Modal Window */
.plugin-modal-window {
    position: absolute;
    width: 90%;
    max-width: 900px;
    height: 80vh;
    max-height: 700px;
    background: #c0c0c0;
    border: 2px outset #ffffff;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    animation: slideDown 0.3s ease-out;
}

/* Title Bar */
.plugin-modal-titlebar {
    background: linear-gradient(to right, #000080, #1084d0);
    color: #ffffff;
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    user-select: none;
    border-bottom: 2px solid #ffffff;
    height: 28px;
    min-height: 28px;
}

.plugin-modal-titlebar:active {
    cursor: grabbing;
}

.plugin-modal-title {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Window Controls */
.plugin-modal-controls {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.plugin-modal-btn {
    width: 20px;
    height: 20px;
    background: #c0c0c0;
    border: 1px outset #ffffff;
    color: #000000;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.plugin-modal-btn:hover {
    background: #d0d0d0;
}

.plugin-modal-btn:active {
    border-style: inset;
}

.plugin-modal-close {
    color: #cc0000;
}

.plugin-modal-close:hover {
    background: #ff0000;
    color: #ffffff;
}

/* Modal Content */
.plugin-modal-content {
    flex: 1;
    background: #c0c0c0;
    border: 2px inset #808080;
    margin: 4px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.plugin-modal-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    padding: 20px 40px;
    border: 2px outset #ffffff;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
    font-family: 'Courier New', monospace;
    color: #000080;
    z-index: 10;
}

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

#plugin-admin-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
    display: none;
}

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

@keyframes slideDown {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .plugin-modal-window {
        width: 95%;
        height: 90vh;
        max-height: none;
    }

    .plugin-modal-titlebar {
        cursor: default; /* Disable dragging on mobile */
    }
}

/* Print styles - hide modal when printing */
@media print {
    .plugin-modal-overlay {
        display: none !important;
    }
}

/* Scrollbar styling for iframe content (if visible) */
.plugin-modal-content ::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

.plugin-modal-content ::-webkit-scrollbar-track {
    background: #c0c0c0;
    border: 1px inset #808080;
}

.plugin-modal-content ::-webkit-scrollbar-thumb {
    background: #808080;
    border: 1px outset #ffffff;
}

.plugin-modal-content ::-webkit-scrollbar-thumb:hover {
    background: #606060;
}

/* Focus state for accessibility */
.plugin-modal-window:focus-within {
    outline: 2px solid #000080;
    outline-offset: -2px;
}
