/**
 * Frontend Styles for eLearning Course Uploader
 */

/* Course Container */
.ecu-course-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.postbox-header {
    padding: 10px !important;
}

/* Course Title */
.ecu-course-title {
    font-size: 1.5em;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Course Author */
.ecu-course-author {
    font-size: 0.9em;
    margin-bottom: 10px;
}

/* Course Description */
.ecu-course-description {
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Course Player */
.ecu-course-player {
    position: relative;
    border: 1px solid #ddd;
    background: #f1f1f1;
    overflow: hidden;
}

/* Course Iframe */
.ecu-course-iframe {
    border: none;
    display: block;
}

/* Controls Container */
.ecu-controls {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    gap: 5px;
    z-index: 10;
}

/* Common Button Styles */
.ecu-fullscreen-button,
.ecu-newtab-button {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 3px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease;
}

.ecu-fullscreen-button:hover,
.ecu-newtab-button:hover {
    background: rgba(0, 0, 0, 0.9);
}

.ecu-newtab-button {
    text-decoration: none;
}

.ecu-fullscreen-button .dashicons,
.ecu-newtab-button .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

/* Error Message */
.ecu-error {
    color: #d63638;
    padding: 10px;
    background: #fef7f7;
    border-left: 4px solid #d63638;
    margin: 15px 0;
}

/* Password Protection Styles */
.ecu-password-protected {
    margin: 20px 0;
}

.ecu-password-protected .ecu-password-prompt {
    max-width: 400px;
    margin: 20px auto;
}

.ecu-password-protected .ecu-password-prompt {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ecu-course-content {
    margin: 20px 0;
}

.ecu-lock-icon {
    margin-bottom: 20px;
}

.ecu-lock-icon .dashicons {
    font-size: 48px;
    color: #666;
    width: 48px;
    height: 48px;
}

.ecu-password-prompt .ecu-course-title {
    margin-bottom: 15px;
    color: #333;
}

.ecu-password-message {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.ecu-password-form {
    max-width: 100%;
}

.ecu-password-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.ecu-password-input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
}

.ecu-password-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.ecu-password-submit {
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s ease;
}

.ecu-password-submit:hover:not(:disabled) {
    background: #005a87;
}

.ecu-password-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.ecu-password-error {
    color: #d63638;
    background: #fef7f7;
    border: 1px solid #d63638;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 10px;
    font-size: 14px;
}

.ecu-password-loading {
    color: #666;
    padding: 8px 12px;
    margin-top: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.ecu-password-loading .dashicons {
    animation: ecu-spin 1s linear infinite;
}

/* Spinner Animation */
@keyframes ecu-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Fullscreen Mode */
.ecu-course-player.is-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 2147483647;
    /* Max z-index */
    background: #000;
}

.ecu-course-player.is-fullscreen .ecu-course-iframe {
    height: 100% !important;
}

.ecu-course-player.is-fullscreen .ecu-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 2147483648;
    /* Higher than container */
    display: flex;
    gap: 10px;
}

/* Button Visibility Toggling */
.ecu-course-player .ecu-exit-fullscreen-button {
    display: none;
    /* Hidden by default */
}

.ecu-course-player.is-fullscreen .ecu-fullscreen-button {
    display: none !important;
    /* Hide fullscreen button in fullscreen */
}

.ecu-course-player.is-fullscreen .ecu-exit-fullscreen-button {
    display: flex !important;
    /* Show exit button in fullscreen */
}

.ecu-exit-fullscreen-button {
    background: rgba(200, 0, 0, 0.7);
    /* Reddish for exit */
    color: #fff;
    border: none;
    border-radius: 3px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease;
}

.ecu-exit-fullscreen-button:hover {
    background: rgba(200, 0, 0, 0.9);
}

.ecu-exit-fullscreen-button svg {
    width: 24px;
    height: 24px;
}