/**
 * SCORMBuddy Player Styles
 * Front-end player styles including modal mode
 */

/* Player Wrapper - Embedded Mode */
.scormbuddy-player-wrapper {
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
}

.scormbuddy-player-container {
    background: #000;
}

.scormbuddy-iframe {
    border: none;
    display: block;
}

.scormbuddy-player-info {
    padding: 10px 15px;
    background: #f9f9f9;
    border-top: 1px solid #e5e5e5;
    text-align: right;
}

.scormbuddy-version {
    color: #666;
    font-size: 12px;
}

/* Error and Info Messages */
.scormbuddy-error {
    background: #fff0f0;
    border-left: 4px solid #dc3232;
    padding: 12px 15px;
    margin: 15px 0;
    color: #444;
}

.scormbuddy-info {
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    padding: 12px 15px;
    margin: 15px 0;
    color: #444;
}

/* Modal Mode */
.scormbuddy-modal-trigger {
    margin: 20px 0;
}

.scormbuddy-launch-button {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
}

.scormbuddy-launch-button:hover {
    background: #135e96;
    color: #fff;
}

.scormbuddy-launch-button:active {
    background: #0a4b78;
}

/* Modal Overlay */
.scormbuddy-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scormbuddy-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

/* Modal Content */
.scormbuddy-modal-content {
    position: relative;
    width: 90vw;
    height: 90vh;
    max-width: 1200px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: scormbuddyModalSlideIn 0.3s ease-out;
}

@keyframes scormbuddyModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Modal Header */
.scormbuddy-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e5e5;
    background: #f9f9f9;
}

.scormbuddy-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.scormbuddy-modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}

.scormbuddy-modal-close:hover {
    background: #e5e5e5;
    color: #000;
}

/* Modal Body */
.scormbuddy-modal-body {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
}

.scormbuddy-modal-body .scormbuddy-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .scormbuddy-modal-content {
        width: 100vw;
        height: 100vh;
        max-width: none;
        border-radius: 0;
    }

    .scormbuddy-modal-title {
        font-size: 16px;
    }

    .scormbuddy-launch-button {
        width: 100%;
        text-align: center;
    }
}

/* Loading State */
.scormbuddy-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.scormbuddy-loading::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e5e5e5;
    border-top-color: #2271b1;
    border-radius: 50%;
    margin-right: 10px;
    animation: scormbuddySpin 0.8s linear infinite;
}

@keyframes scormbuddySpin {
    to {
        transform: rotate(360deg);
    }
}

/* Accessibility */
.scormbuddy-modal:focus-within {
    outline: none;
}

.scormbuddy-modal-close:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.scormbuddy-launch-button:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .scormbuddy-modal,
    .scormbuddy-launch-button {
        display: none;
    }
}
