/* Practice Exam Authorization Styles */

/* Auth Container */
.pea-auth-container {
    max-width: 700px;
    margin: 50px auto;
    padding: 20px;
    text-align: center;
}

/* Ensure container is centered on page */
body.pea-auth-required .pea-auth-container {
    margin-left: auto;
    margin-right: auto;
}

.pea-auth-form-wrapper {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 40px;
    text-align: left;
}

/* Auth Header */
.pea-auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.pea-auth-header h2 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
}

.pea-auth-header p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Form Styles */
.pea-auth-form {
    margin: 30px 0;
}

.pea-form-field {
    margin-bottom: 20px;
}

.pea-form-field label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.pea-form-field input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.pea-form-field input[type="email"]:focus {
    outline: none;
    border-color: #1c526e;
    box-shadow: 0 0 0 2px rgba(28, 82, 110, 0.1);
}

/* Button Styles */
.pea-button {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-align: center;
}

.pea-button-primary {
    background: #1c526e;
    color: #ffffff;
}

.pea-button-primary:hover {
    background: #153f54;
    color: #ffffff;
}

.pea-button-primary:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.pea-button-secondary {
    background: #f7f7f7;
    color: #333;
    border: 1px solid #ddd;
}

.pea-button-secondary:hover {
    background: #e8e8e8;
}

.pea-submit-field {
    text-align: center;
    margin-top: 30px;
}

.pea-submit-field .pea-button {
    width: 100%;
}

/* Message Styles */
.pea-message {
    margin: 20px 0;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
}

.pea-message p {
    margin: 0;
}

.pea-message.pea-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.pea-message.pea-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.pea-message.pea-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Loading State */
.pea-loading {
    text-align: center;
    padding: 40px 0;
}

.pea-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1c526e;
    border-radius: 50%;
    animation: pea-spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes pea-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pea-loading p {
    color: #666;
    font-size: 16px;
}

/* Success Content */
.pea-success-message {
    text-align: center;
    padding: 20px;
}

.pea-success-message h3 {
    color: #28a745;
    font-size: 24px;
    margin-bottom: 10px;
}

/* Auth Footer */
.pea-auth-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.pea-auth-footer p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.pea-auth-footer a {
    color: #1c526e;
    text-decoration: none;
}

.pea-auth-footer a:hover {
    text-decoration: underline;
}

/* Auth Notice */
.pea-auth-notice {
    margin-bottom: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

.pea-auth-notice.pea-auth-notice-top {
    margin-bottom: 40px;
}

.pea-auth-notice p {
    color: #495057;
    font-size: 18px;
    line-height: 1.7;
    margin: 0 0 10px 0;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
}

.pea-auth-notice p:last-child {
    margin-bottom: 0;
}

/* Access Denied Styles */
.pea-access-denied {
    max-width: 600px;
    margin: 50px auto;
    padding: 20px;
}

.pea-access-denied-content {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
}

.pea-access-denied h2 {
    color: #dc3545;
    font-size: 32px;
    margin-bottom: 20px;
}

.pea-access-denied-message {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

.pea-reasons {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    margin: 30px 0;
    text-align: left;
}

.pea-reasons h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.pea-reasons ul {
    margin: 0;
    padding-left: 20px;
}

.pea-reasons li {
    margin-bottom: 8px;
    color: #666;
}

.pea-actions {
    margin-top: 30px;
}

.pea-actions p {
    color: #666;
    margin-bottom: 20px;
}

.pea-action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Exam Active Notice */
.pea-exam-active-notice {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.pea-exam-notice-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pea-exam-notice-content h4 {
    margin: 0;
    color: #0c5460;
    font-size: 16px;
}

.pea-exam-notice-content p {
    margin: 0;
    color: #0c5460;
}

#pea-exam-timer {
    font-family: monospace;
    font-size: 18px;
    color: #155724;
}

/* Shake Animation */
@keyframes pea-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.pea-shake {
    animation: pea-shake 0.5s ease-in-out;
}

/* Body Classes */
body.pea-restricted .site-main {
    min-height: 400px;
}

body.pea-authorization-success {
    pointer-events: none;
}

/* Force full width layout when auth required */
body.pea-auth-required #primary {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
}

body.pea-auth-required #secondary,
body.pea-auth-required .widget-area,
body.pea-auth-required .col-md-4 {
    display: none;
}

/* Ensure main content takes full width */
body.pea-auth-required .col-md-8 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
}

/* Admin Bar Indicator */
#wpadminbar .pea-restricted .ab-label {
    color: #dc3545;
}

#wpadminbar .pea-authorized .ab-label {
    color: #28a745;
}

/* Responsive Design */
@media (max-width: 600px) {
    .pea-auth-form-wrapper {
        padding: 20px;
    }
    
    .pea-auth-header h2 {
        font-size: 24px;
    }
    
    .pea-action-buttons {
        flex-direction: column;
    }
    
    .pea-action-buttons .pea-button {
        width: 100%;
    }
}