/**
 * QR Activation Frontend Styles
 */

 p.qr-instruction {
    margin: 20px 0;
    text-align: center;
}

 #qr-code {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#qr-code img{
    max-height: 50vh;
    width: auto;
}

.qr-activation-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.qr-activation-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

.class-info-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.class-info-section h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.qr-activation-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.qr-activation-header {
    text-align: center;
    margin-bottom: 30px;
}

.qr-activation-header h1 {
    color: white;
    font-size: 1.8rem;
    line-height: 2rem;
    text-transform: uppercase;
    margin: 0;
    margin-top: 50px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.qr-activation-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.courses-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #28a745;
}

.courses-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2rem;
}

.courses-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.courses-list li {
    padding: 5px 0;
    color: #555;
    font-size: 1rem;
}

.auth-section {
    margin-bottom: 30px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    color: #495057;
    background: #f8f9fa;
}

.tab-button.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: #f8f9fa;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.auth-form {
    padding: 20px 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group label .required {
    color: #dc3545;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.form-group input:invalid {
    border-color: #dc3545;
}

.form-group input:valid {
    border-color: #28a745;
}

/* Password confirmation validation */
.form-group input[name="confirm_password"] {
    position: relative;
}

.form-group input[name="confirm_password"]:not(:placeholder-shown) {
    border-color: #dc3545;
}

.form-group input[name="confirm_password"]:not(:placeholder-shown):valid {
    border-color: #28a745;
}

/* Real-time validation feedback */
.form-group .validation-message {
    font-size: 0.875rem;
    margin-top: 5px;
    display: none;
}

.form-group .validation-message.error {
    color: #dc3545;
    display: block;
}

.form-group .validation-message.success {
    color: #28a745;
    display: block;
}

/* Loading state for buttons */
.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button.loading {
    position: relative;
    color: transparent;
}

.button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.button {
    display: inline-block;
    padding: 12px 30px;
    background: #28a745;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.button:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: #1e7e34;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40,167,69,0.3);
}

.button-primary,
button.button-primary,
input[type="submit"].button-primary,
input[type="button"].button-primary {
    background: #28a745;
}

.button-primary:hover,
button.button-primary:hover,
input[type="submit"].button-primary:hover,
input[type="button"].button-primary:hover {
    background: #1e7e34;
    box-shadow: 0 4px 12px rgba(40,167,69,0.3);
}

.instructions {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: #e3f2fd;
    border-radius: 8px;
    color: #1976d2;
}

.loading-message {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.result-message {
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

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

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

button#cancel-activation {
    background: #fff;
    border: 1px solid gray;
    color: gray;
}

/* Enhanced result message styles */
#result-message {
    max-width: 600px;
    margin: 20px auto;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.6;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

#result-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #28a745, #20c997);
}

#result-message.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    color: #155724;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.2);
}

#result-message.success::before {
    background: linear-gradient(90deg, #28a745, #20c997);
}

#result-message.success::after {
    content: '✅';
    font-size: 1.5em;
    margin-right: 10px;
    vertical-align: middle;
}

#result-message.error {
    background: linear-gradient(135deg, #f2e0e1 0%, #f6f1f2 100%);
    border: 2px solid #dc3545;
    color: #721c24;
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.2);
}

#result-message.error::before {
    background: linear-gradient(90deg, #dc3545, #fd7e14);
}

#result-message.error::after {
    content: '❌';
    font-size: 1.5em;
    margin-right: 10px;
    vertical-align: middle;
}

#result-message p {
    margin: 0;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#result-message.show {
    display: block !important;
    animation: slideInDown 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Hover effect for interactive messages */
#result-message:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Dashboard button styles */
.dashboard-actions {
    text-align: center;
    margin: 30px 0;
}

.dashboard-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 25px;
    color: white;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    position: relative;
    overflow: hidden;
}

.dashboard-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.dashboard-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    color: white;
    text-decoration: none;
}

.dashboard-button:hover::before {
    left: 100%;
}

.dashboard-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3);
}

.activation-success {
    text-align: center;
    padding: 20px;
}

.activation-success h2 {
    color: #28a745;
    margin-bottom: 20px;
}

.courses-activated {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: left;
}

.courses-activated h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.courses-activated ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.courses-activated li {
    padding: 5px 0;
    color: #555;
}

.access-section {
    margin-top: 30px;
}

.access-section .button {
    background: #28a745;
    font-size: 1.1rem;
    padding: 15px 30px;
}

.access-section .button:hover {
    background: #1e7e34;
    box-shadow: 0 4px 12px rgba(40,167,69,0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .qr-activation-container {
        padding: 15px;
    }
    
    .qr-activation-header h1 {
        font-size: 1.5rem;
        line-height: 1.8rem;
    }
    
    .qr-activation-content {
        padding: 20px;
    }
    
    .tab-button {
        padding: 12px 15px;
        font-size: 1rem;
    }
}

/* Error page styles */
.qr-activation-error {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-activation-error .qr-activation-container {
    max-width: 500px;
    padding: 20px;
}

.qr-activation-error .error-message {
    background: white;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.qr-activation-error .error-message h1 {
    color: #dc3545;
    margin-bottom: 20px;
    font-size: 1.6rem;
}

.qr-activation-error .error-message p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Activation Confirmation Styles */
.activation-confirmation {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.activation-confirmation h3 {
    color: #28a745;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

.confirmation-info {
    margin-bottom: 30px;
}

.confirmation-info p {
    color: #666;
    margin-bottom: 20px;
    font-size: 1rem;
}

.user-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    text-align: left;
}

.user-info-item {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.user-info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.user-info-item strong {
    color: #495057;
    display: inline-block;
    width: 120px;
    font-weight: 600;
}

.confirmation-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.confirmation-actions .button {
    min-width: 140px;
    padding: 12px 20px;
}

.button-secondary {
    background: #6c757d;
    color: white;
}

.button-secondary:hover {
    background: #5a6268;
    color: white;
}

/* Responsive */
@media (max-width: 480px) {
    .activation-confirmation {
        padding: 20px;
        margin: 10px;
    }
    
    .confirmation-actions {
        flex-direction: column;
    }
    
    .confirmation-actions .button {
        width: 100%;
    }
    
    .user-info-item strong {
        width: 100px;
        font-size: 0.9rem;
    }
}