/* Test Taker Plugin Styles - Version 2.1 */

/* ===== Base Styles ===== */
.test-container,
.test-list,
.payment-required-section,
.test-results,
.test-login-required,
.test-error {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== Test List Styles ===== */
.test-list h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3338;
    font-size: 2em;
}

.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.test-card {
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.test-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.test-card-header h3 {
    margin: 0;
    font-size: 1.3em;
    flex: 1;
}

.test-price {
    background: rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
    backdrop-filter: blur(10px);
}

.test-price.free {
    background: rgba(76,175,80,0.2);
}

.test-card-body {
    padding: 20px;
    flex: 1;
}

.test-meta {
    margin-bottom: 15px;
}

.questions {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.test-description {
    color: #666;
    line-height: 1.5;
    font-size: 0.95em;
}

.payment-status.paid {
    background: #e8f5e8;
    border: 1px solid #4caf50;
    color: #2e7d32;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.test-card-footer {
    padding: 0 20px 20px;
}

.start-test {
    width: 100%;
    text-align: center;
    padding: 12px;
    font-size: 1.em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.payment-note {
    font-size: 0.8em;
    color: #666;
    margin-top: 8px;
    text-align: center;
}

/* ===== Test Container Styles ===== */
.test-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 20px auto;
}

.test-header {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 30px;
    border-radius: 12px 12px 0 0;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

.test-title-section h1 {
    margin: 0 0 15px 0;
    color: #2c3338;
    font-size: 2.2em;
}

.test-description {
    color: #666;
    line-height: 1.6;
}

.test-info-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #666;
}

.info-value {
    font-weight: bold;
    color: #2c3338;
}

.status-ready,
.status-paid {
    color: #4caf50;
    display: flex;
    align-items: center;
    gap: 5px;
}

.test-instructions {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 20px;
    margin: 20px 30px;
    border-radius: 0 8px 8px 0;
}

.test-instructions h3 {
    margin: 0 0 10px 0;
    color: #1976d2;
}

.test-instructions ul {
    margin: 0;
    padding-left: 20px;
}

.test-instructions li {
    margin-bottom: 5px;
    line-height: 1.5;
}

.questions-container {
    padding: 30px;
}

.question-block {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.question-block:hover {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0,124,186,0.1);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.question-number {
    font-weight: 600;
    color: #007cba;
    font-size: 0.9em;
}

.question-text {
    margin: 0 0 20px 0;
    color: #2c3338;
    font-size: 1.2em;
    line-height: 1.4;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 15px;
    margin: 0;
    cursor: pointer;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: white;
    gap: 15px;
}

.option-label:hover {
    border-color: #007cba;
    background: #f0f8ff;
}

.option-label input[type="radio"] {
    display: none;
}

.option-marker {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.option-label input[type="radio"]:checked + .option-marker {
    border-color: #007cba;
    background: #007cba;
}

.option-label input[type="radio"]:checked + .option-marker::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.option-text {
    flex: 1;
    font-size: 1em;
    line-height: 1.4;
}

.test-submit-section {
    padding: 30px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.submit-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.submit-test {
    padding: 15px 30px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.test-progress {
    text-align: right;
}

.progress-text {
    font-weight: 600;
    color: #666;
}

.test-progress.complete .progress-text {
    color: #4caf50;
}

/* ===== Payment Section Styles ===== */
.payment-required-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 20px auto;
    overflow: hidden;
}

.payment-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.payment-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
}

.payment-header p {
    margin: 0;
    font-size: 1.2em;
    opacity: 0.9;
}

.payment-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    padding: 30px;
}

.payment-summary {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.test-info-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
}

.test-info-card h3 {
    margin: 0 0 15px 0;
    color: #2c3338;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 10px;
}

.test-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.detail-item .label {
    font-weight: 600;
    color: #666;
}

.detail-item .value {
    font-weight: bold;
    color: #2c3338;
}

.detail-item .value.price {
    color: #e74c3c;
    font-size: 1.1em;
}

.detail-item .value.method {
    color: #3498db;
}

.payment-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.payment-option {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.payment-option:hover {
    border-color: #3498db;
    box-shadow: 0 4px 15px rgba(52,152,219,0.2);
}

.option-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.option-header h3 {
    margin: 0;
    color: #2c3338;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    background: #e74c3c;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
}

.option-content {
    padding: 25px;
}

.payment-instructions {
    background: #e8f4fd;
    border: 1px solid #b3e5fc;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.payment-instructions h4 {
    margin: 0 0 10px 0;
    color: #0288d1;
}

.payment-instructions ol {
    margin: 0;
    padding-left: 20px;
}

.payment-instructions li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.security-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.9em;
}

.payment-button {
    width: 100%;
    padding: 18px;
    font-size: 1.1em;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.payment-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px;
    margin-top: 20px;
    color: #856404;
}

.payment-note p {
    margin: 0 0 10px 0;
}

.payment-note p:last-child {
    margin-bottom: 0;
}

/* Payment Form Styles */
.payment-form {
    margin-top: 20px;
}

.payment-fields {
    margin: 20px 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3338;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .dashicons {
    position: absolute;
    left: 12px;
    color: #666;
    z-index: 2;
}

.input-with-icon input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-with-icon input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}

.payment-security {
    text-align: center;
    margin: 20px 0;
}

.secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e8f5e8;
    color: #2e7d32;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.accepted-cards {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.card-icons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.card-icon {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    color: #666;
}

.payment-support {
    padding: 30px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.support-card {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.support-card h4 {
    margin: 0 0 15px 0;
    color: #2c3338;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.support-card ul {
    margin: 15px 0 0 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.support-card li {
    padding: 5px 0;
    color: #666;
}

/* Payment Messages */
.payment-success,
.payment-error {
    background: white;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.payment-success {
    border-left: 4px solid #4caf50;
}

.payment-error {
    border-left: 4px solid #f44336;
}

.success-content .dashicons,
.error-content .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
}

.success-content .dashicons {
    color: #4caf50;
}

.error-content .dashicons {
    color: #f44336;
}

.success-content h3,
.error-content h3 {
    margin: 0 0 10px 0;
    color: #2c3338;
}

.success-actions {
    margin-top: 20px;
}

/* ===== Test Results Styles ===== */
.test-results {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 20px auto;
    overflow: hidden;
}

.results-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.results-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.2em;
}

.test-date {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1em;
}

.results-summary {
    padding: 40px 30px;
    text-align: center;
}

.score-card {
    display: inline-flex;
    align-items: center;
    gap: 30px;
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(102,126,234,0.3);
}

.score-circle.large {
    width: 150px;
    height: 150px;
}

.score-percentage {
    font-size: 2em;
    font-weight: bold;
}

.score-details h3 {
    margin: 0 0 10px 0;
    color: #2c3338;
    font-size: 1.5em;
}

.score-text {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 1.1em;
}

.score-grade {
    margin: 0;
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.2em;
}

.results-breakdown {
    padding: 30px;
    background: #f8f9fa;
}

.results-breakdown h2 {
    margin: 0 0 20px 0;
    color: #2c3338;
    text-align: center;
}

.questions-review {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-question {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.review-question.correct {
    border-color: #4caf50;
    background: #f1f8e9;
}

.review-question.incorrect {
    border-color: #f44336;
    background: #ffebee;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.result-indicator .correct {
    color: #4caf50;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.result-indicator .incorrect {
    color: #f44336;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.question-text {
    font-weight: 600;
    color: #2c3338;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.answers-comparison {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-answer,
.correct-answer {
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.95em;
}

.user-answer {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.correct-answer {
    background: #e8f5e8;
    border-left: 4px solid #4caf50;
}

.results-actions {
    padding: 30px;
    text-align: center;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* ===== Login Required Styles ===== */
.test-login-required {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 20px auto;
    padding: 60px 30px;
    text-align: center;
}

.login-required-message h2 {
    margin: 0 0 15px 0;
    color: #2c3338;
    font-size: 2em;
}

.login-required-message p {
    margin: 0 0 30px 0;
    color: #666;
    font-size: 1.1em;
}

.login-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* ===== Test Result Display ===== */
.test-result {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 20px auto;
    padding: 40px;
    text-align: center;
}

.result-header h2 {
    margin: 0 0 30px 0;
    color: #2c3338;
    font-size: 2em;
}

.result-score {
    display: inline-flex;
    align-items: center;
    gap: 30px;
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
}

/* ===== Utility Classes ===== */
.dashicons.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.button {
    display: inline-block;
    background: #f8f9fa;
    color: #2c3338;
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.button:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.button-primary {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.button-primary:hover {
    background: #005a87;
    border-color: #005a87;
}

.button-danger {
    background: #dc3232;
    color: white;
    border-color: #dc3232;
}

.button-danger:hover {
    background: #b32d2d;
    border-color: #b32d2d;
}

.button-large {
    padding: 15px 30px;
    font-size: 16px;
}

.button-small {
    padding: 6px 12px;
    font-size: 12px;
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .test-container,
    .test-list,
    .payment-required-section,
    .test-results {
        padding: 15px;
        margin: 10px;
    }
    
    .tests-grid {
        grid-template-columns: 1fr;
    }
    
    .test-header {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .payment-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .submit-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .score-card {
        flex-direction: column;
        text-align: center;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .login-buttons {
        flex-direction: column;
    }
}

/* ===== Print Styles ===== */
@media print {
    .test-container,
    .test-results {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
    
    .button,
    .test-instructions,
    .payment-required-section {
        display: none;
    }
}