/* RMIT EPT Public Styles */

/* CSS Custom Properties - Inherit from theme or use fallback colors */
:root {
    --rmit-theme-color: var(--wp--preset--color--primary, #eb1f27);
    --rmit-accent-color: var(--wp--preset--color--secondary, #eb1f27);
    --rmit-link-color: var(--wp--preset--color--link, #eb1f27);
    --rmit-link-hover-color: var(--wp--preset--color--link-hover, #2c3e50);
    --rmit-heading-color: var(--wp--preset--color--heading, #2c3e50);
    --rmit-body-text-color: var(--wp--preset--color--text, #34495e);
    --rmit-border-color: var(--wp--preset--color--border, #e0e0e0);
    --rmit-site-background: var(--wp--preset--color--background, #ffffff);
    --rmit-content-background: var(--wp--preset--color--surface, #ffffff);
    --rmit-button-bg: var(--wp--preset--color--button-background, #eb1f27);
    --rmit-button-text: var(--wp--preset--color--button-text, #ffffff);
    --rmit-button-hover-bg: var(--wp--preset--color--button-hover-background, #2c3e50);
    --rmit-button-hover-text: var(--wp--preset--color--button-hover-text, #ffffff);
}

/* Test Interface Styles */
.rmit-ept-test-container { 
    max-width: 800px; 
    margin: 0 auto; 
    background: var(--rmit-content-background); 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
    overflow: hidden;
    border: 1px solid var(--rmit-border-color);
}

.rmit-ept-test-header { 
    background: linear-gradient(135deg, var(--rmit-theme-color), var(--rmit-accent-color)); 
    color: var(--rmit-button-text); 
    padding: 30px; 
    text-align: center; 
}

.rmit-ept-test-header h2 { 
    margin: 0 0 10px 0; 
    font-size: 28px; 
}

.rmit-ept-test-progress { 
    background: var(--rmit-site-background); 
    padding: 20px; 
    border-bottom: 1px solid var(--rmit-border-color); 
}

.rmit-ept-progress-bar { 
    background: var(--rmit-border-color); 
    height: 20px; 
    border-radius: 10px; 
    overflow: hidden; 
    margin-bottom: 10px; 
}

.rmit-ept-progress-fill { 
    background: linear-gradient(90deg, var(--rmit-theme-color), var(--rmit-accent-color)); 
    height: 100%; 
    border-radius: 10px; 
    transition: width 0.3s ease; 
}

.rmit-ept-progress-text { 
    text-align: center; 
    font-weight: 500; 
    color: var(--rmit-body-text-color); 
}

.rmit-ept-question-container { 
    padding: 40px; 
}

.rmit-ept-question-info { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 20px; 
    font-size: 14px; 
    color: var(--rmit-body-text-color); 
}

.rmit-ept-question-text { 
    font-size: 20px; 
    line-height: 1.6; 
    margin-bottom: 30px; 
    color: var(--rmit-heading-color); 
}

.rmit-ept-options { 
    margin: 20px 0; 
}

.rmit-ept-option { 
    margin-bottom: 15px; 
    padding: 15px; 
    border: 2px solid var(--rmit-border-color); 
    border-radius: 8px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    background: var(--rmit-content-background); 
}

.rmit-ept-option:hover { 
    border-color: var(--rmit-link-color); 
    background: #f8f9ff; /* Fallback */
    background: color-mix(in srgb, var(--rmit-link-color) 5%, var(--rmit-content-background)); 
}

.rmit-ept-option.selected { 
    border-color: var(--rmit-link-color); 
    background: #e7f3ff; /* Fallback */
    background: color-mix(in srgb, var(--rmit-link-color) 10%, var(--rmit-content-background)); 
}

.rmit-ept-option input[type='radio'] { 
    margin-right: 12px; 
    transform: scale(1.2); 
}

.rmit-ept-option label { 
    cursor: pointer; 
    font-size: 16px; 
    line-height: 1.5; 
    margin: 0; 
    display: flex; 
    align-items: flex-start; 
}

/* True/False specific styles */
.rmit-ept-true-false { 
    display: flex; 
    gap: 20px; 
    justify-content: center; 
    flex-wrap: wrap; 
}

.rmit-ept-true-false .rmit-ept-option { 
    flex: 1; 
    max-width: 200px; 
    min-width: 150px; 
    text-align: center; 
    background: var(--rmit-site-background); 
    border: 2px solid var(--rmit-border-color); 
}

.rmit-ept-true-false .rmit-ept-option:hover { 
    background: color-mix(in srgb, var(--rmit-border-color) 25%, var(--rmit-site-background));
    background: #e9ecef; /* Fallback */
    border-color: var(--rmit-link-color); 
}

.rmit-ept-true-false .rmit-ept-option.selected { 
    background: color-mix(in srgb, var(--rmit-link-color) 15%, var(--rmit-content-background));
    background: #d1ecf1; /* Fallback */
    border-color: var(--rmit-link-color); 
}

.rmit-ept-true-false .rmit-ept-option label { 
    justify-content: center; 
    font-weight: 600; 
}

.rmit-ept-tf-option { 
    font-size: 18px; 
    font-weight: 600; 
    color: var(--rmit-body-text-color); 
}

/* Essay and Fill-in-the-blank input styles */
.rmit-ept-essay-input { 
    margin: 20px 0; 
}

.rmit-ept-essay-input textarea { 
    width: 100%; 
    padding: 15px; 
    border: 2px solid var(--rmit-border-color); 
    border-radius: 8px; 
    font-size: 16px; 
    font-family: inherit; 
    resize: vertical; 
    min-height: 200px; 
    background: var(--rmit-content-background);
    color: var(--rmit-body-text-color);
}

.rmit-ept-essay-input textarea:focus { 
    border-color: var(--rmit-link-color); 
    outline: none; 
    box-shadow: 0 0 0 3px rgba(235, 31, 39, 0.1); /* Fallback */
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rmit-link-color) 10%, transparent); 
}

.rmit-ept-fill-input { 
    margin: 20px 0; 
}

.rmit-ept-fill-input input[type="text"] { 
    width: 100%; 
    max-width: 400px; 
    padding: 15px; 
    border: 2px solid var(--rmit-border-color); 
    border-radius: 8px; 
    font-size: 18px; 
    text-align: center; 
    background: var(--rmit-content-background);
    color: var(--rmit-body-text-color);
}

.rmit-ept-fill-input input[type="text"]:focus { 
    border-color: var(--rmit-link-color); 
    outline: none; 
    box-shadow: 0 0 0 3px rgba(235, 31, 39, 0.1); /* Fallback */
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rmit-link-color) 10%, transparent); 
}

.rmit-ept-navigation { 
    padding: 30px 40px; 
    background: var(--rmit-site-background); 
    border-top: 1px solid var(--rmit-border-color); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.rmit-ept-btn { 
    padding: 12px 24px; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 16px; 
    font-weight: 500; 
    text-decoration: none; 
    display: inline-block; 
    transition: all 0.2s ease; 
}

.rmit-ept-btn-primary { 
    background: var(--rmit-button-bg); 
    color: var(--rmit-button-text); 
}

.rmit-ept-btn-primary:hover { 
    background: var(--rmit-button-hover-bg); 
    color: var(--rmit-button-hover-text); 
}

.rmit-ept-btn-secondary { 
    background: var(--rmit-link-hover-color); 
    color: var(--rmit-button-text); 
}

.rmit-ept-btn-secondary:hover { 
    background: #1a252f; /* Fallback */
    background: color-mix(in srgb, var(--rmit-link-hover-color) 85%, black); 
    color: var(--rmit-button-text); 
}

.rmit-ept-btn:disabled { 
    opacity: 0.6; 
    cursor: not-allowed; 
}

/* Student Form Styles */
.rmit-ept-student-form { 
    background: var(--rmit-site-background); 
    padding: 30px; 
    border-radius: 8px; 
    margin-bottom: 30px; 
    border: 1px solid var(--rmit-border-color);
}

.rmit-ept-student-form .form-table { 
    width: 100%; 
    margin-bottom: 20px; 
}

.rmit-ept-student-form .form-table th { 
    padding: 15px 20px 15px 0; 
    width: 150px; 
    text-align: left;
    vertical-align: top;
    font-weight: 600;
}

.rmit-ept-student-form .form-table td { 
    padding: 10px 0; 
}

.rmit-ept-student-form input[type='text'], 
.rmit-ept-student-form input[type='email'],
.rmit-ept-student-form select { 
    padding: 8px 12px; 
    border: 1px solid var(--rmit-border-color); 
    border-radius: 4px; 
    width: 100%;
    max-width: 300px;
    background: var(--rmit-content-background);
    color: var(--rmit-body-text-color);
}

.rmit-ept-error-message { 
    background: #f8d7da; 
    color: #721c24; 
    padding: 15px; 
    border-radius: 6px; 
    margin: 20px 0; 
    border: 1px solid #f5c6cb; 
}

.rmit-ept-error-message ul {
    margin: 5px 0 0 20px;
}

/* Results Styles */
.rmit-ept-results { 
    padding: 40px; 
    text-align: center; 
}

.rmit-ept-score { 
    font-size: 48px; 
    font-weight: bold; 
    color: var(--rmit-theme-color); 
    margin: 20px 0; 
}

.rmit-ept-level-badge { 
    display: inline-block; 
    padding: 12px 24px; 
    background: var(--rmit-button-bg); 
    color: var(--rmit-button-text); 
    border-radius: 25px; 
    font-size: 18px; 
    font-weight: 500; 
    margin: 20px 0; 
}

.rmit-ept-level-description { 
    background: var(--rmit-site-background); 
    padding: 20px; 
    border-radius: 8px; 
    margin: 20px 0; 
    text-align: left; 
    border: 1px solid var(--rmit-border-color);
}

.rmit-ept-start-screen { 
    padding: 40px; 
    text-align: center; 
}

.rmit-ept-start-screen h3 { 
    margin-bottom: 20px; 
    color: var(--rmit-heading-color); 
}

.rmit-ept-start-screen p { 
    margin-bottom: 15px; 
    color: var(--rmit-body-text-color); 
    line-height: 1.6; 
}

.rmit-ept-start-screen ul { 
    text-align: left; 
    max-width: 500px; 
    margin: 20px auto; 
}

.rmit-ept-error { 
    background: #f8d7da; 
    color: #721c24; 
    padding: 15px; 
    border-radius: 6px; 
    margin: 20px 0; 
}

/* Debug Info */
.rmit-ept-debug { 
    background: #fff3cd; 
    border: 1px solid #ffeaa7; 
    padding: 10px; 
    margin: 10px 0; 
    font-size: 12px; 
    font-family: monospace; 
}

/* Responsive Design */
@media (max-width: 768px) {
    .rmit-ept-test-container { 
        margin: 10px; 
        border-radius: 0; 
    }
    
    .rmit-ept-question-container, 
    .rmit-ept-navigation, 
    .rmit-ept-results, 
    .rmit-ept-start-screen { 
        padding: 20px; 
    }
    
    .rmit-ept-test-header { 
        padding: 20px; 
    }
    
    .rmit-ept-test-header h2 { 
        font-size: 24px; 
    }
    
    .rmit-ept-question-text { 
        font-size: 18px; 
    }
    
    .rmit-ept-navigation { 
        flex-direction: column; 
        gap: 15px; 
    }

    .rmit-ept-student-form .form-table th { 
        width: 100px; 
        font-size: 14px;
    }

    .rmit-ept-student-form input[type='text'], 
    .rmit-ept-student-form input[type='email'],
    .rmit-ept-student-form select { 
        max-width: 100%;
    }
}

/* Test Security Styles */
.rmit-ept-no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
}

.rmit-ept-no-select * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Force disable context menu globally */
body {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

html {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow selection in input fields */
.rmit-ept-no-select input,
.rmit-ept-no-select textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Disable text selection highlighting */
::selection {
    background: transparent;
}

::-moz-selection {
    background: transparent;
}

/* Additional styles that might have been inline */
.top-nav {
    background: var(--rmit-site-background);
    padding: 8px 20px;
    border-bottom: 1px solid var(--rmit-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.top-nav a {
    color: var(--rmit-link-color);
    text-decoration: none;
    font-size: 14px;
}

.top-nav a:hover {
    text-decoration: underline;
    color: var(--rmit-link-hover-color);
}

.page-title {
    padding: 20px;
    font-size: 24px;
    font-weight: normal;
    color: var(--rmit-heading-color);
    margin: 0;
}

.main-header {
    background: var(--rmit-theme-color);
    padding: 30px 20px;
    text-align: center;
    border-radius: 8px 8px 0 0;
    margin: 0 20px;
}

.main-header h1 {
    color: var(--rmit-button-text);
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 8px;
}

.main-header p {
    color: color-mix(in srgb, var(--rmit-button-text) 70%, transparent);
    color: rgba(255, 255, 255, 0.7); /* Fallback */
    font-size: 16px;
    font-weight: normal;
}


.section-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--rmit-heading-color);
    margin-bottom: 20px;
    text-align: center;
}

.instructions-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--rmit-heading-color);
    margin-bottom: 15px;
}

.instructions-list {
    margin-bottom: 30px;
    padding-left: 20px;
}

.instructions-list li {
    margin-bottom: 8px;
    color: var(--rmit-body-text-color);
    font-size: 14px;
}

.start-button {
    background: var(--rmit-button-bg);
    color: var(--rmit-button-text);
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    display: block;
    margin: 0 auto;
}

.start-button:hover {
    background: var(--rmit-button-hover-bg);
    color: var(--rmit-button-hover-text);
}

/* Override inline styles with CSS custom properties */
.rmit-ept-results .question-result-item {
    border-color: var(--rmit-border-color) !important;
}

.rmit-ept-results .question-result-item h5 {
    color: var(--rmit-heading-color) !important;
}

.rmit-ept-results .question-result-item span {
    color: var(--rmit-body-text-color) !important;
}

.rmit-ept-results .result-status {
    color: var(--rmit-theme-color) !important;
}

.rmit-ept-results div[style*="background: #f8f9fa"] {
    background: var(--rmit-site-background) !important;
}

.rmit-ept-results div[style*="background: #e9ecef"] {
    background: color-mix(in srgb, var(--rmit-border-color) 30%, var(--rmit-site-background)) !important;
    background: #e9ecef !important; /* Fallback */
}

.rmit-ept-results div[style*="border-left: 4px solid #6c757d"] {
    border-left-color: var(--rmit-link-hover-color) !important;
}

.rmit-ept-results div[style*="color: #28a745"] {
    color: var(--rmit-button-bg) !important;
}

.rmit-ept-results div[style*="color: #dc3545"] {
    color: var(--rmit-link-color) !important;
}