/**
 * AAE Sandbox Demo Widget Styles
 * Enhanced with modern design and interactive features
 */

.aae-sandbox-demo-widget {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Header Styles */
.aae-sandbox-header {
    text-align: left;
    margin-bottom: 30px;
}

.aae-sandbox-title {
    font-size: 28px;
    font-weight: 700;
    color: #333333;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.aae-sandbox-description {
    font-size: 16px;
    color: #666666;
    margin: 0;
    line-height: 1.5;
}

/* Form Styles */
.aae-sandbox-form {
    text-align: left;
}

.aae-sandbox-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.aae-sandbox-form-group {
    margin-bottom: 25px;
    position: relative;
}

.aae-sandbox-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 8px;
    text-align: left;
}

.aae-sandbox-form-group input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    color: #333333;
    background: #ffffff;
    transition: all 0.3s ease;
    box-sizing: border-box;
    position: relative;
    padding-left: 40px !important;
}

.aae-sandbox-form-group input:focus {
    outline: none;
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.aae-sandbox-form-group input::placeholder {
    color: #999999;
}

/* Input Wrapper and Icons */
.aae-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.aae-input-icon {
    position: absolute;
    left: 15px;
    width: 20px;
    height: 20px;
    color: #999999;
    z-index: 2;
    pointer-events: none;
}

/* Helper Text */
.aae-sandbox-form-group small {
    display: block;
    font-size: 13px;
    color: #666666;
    margin-top: 6px;
    line-height: 1.4;
    text-align: left;
}

/* Form Actions */
.aae-sandbox-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: flex-end;
}

.aae-sandbox-cancel,
.aae-sandbox-submit {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 120px;
}

.aae-sandbox-cancel {
    background: #ffffff;
    color: #666666;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
}

.aae-sandbox-cancel:hover {
    background: #f8f9fa;
    border-color: #d1d5db;
    color: #333333;
}

.aae-sandbox-submit {
    background-color: #F6502C;
    color: #ffffff;
    border: 1px solid #F6502C;
    border-radius: 20px;
}

.aae-sandbox-submit:hover:not(:disabled) {
    background: #c82333;
    border-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.aae-sandbox-submit:disabled {
    background: #cccccc;
    border-color: #cccccc;
    color: #999999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading State */
.aae-sandbox-submit.loading {
    position: relative;
    color: transparent;
    background: #dc3545;
    border-color: #dc3545;
    cursor: wait;
    pointer-events: none;
    color: white;
}

.aae-sandbox-submit.loading .spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Validation States */
.aae-sandbox-form-group input.valid {
    border-color: #28a745;
    background-color: #f8fff9;
}

.aae-sandbox-form-group input.error {
    border-color: #dc3545;
    background-color: #fff8f8;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Error Messages */
.field-error {
    display: none;
}

/* Character Counters */
.char-counter {
    display: none;
}

/* Messages */
.aae-sandbox-message {
    margin: 20px 0;
    padding: 20px;
    border-radius: 8px;
    display: none;
    text-align: left;
    font-weight: 500;
    border: 2px solid transparent;
}

.aae-sandbox-message.success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
    box-shadow: 0 2px 8px rgba(21, 87, 36, 0.1);
}

.aae-sandbox-message.error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
    box-shadow: 0 2px 8px rgba(114, 28, 36, 0.1);
}

/* Success and Error Message Styles */
.aae-sandbox-success-message {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.15);
}

.aae-sandbox-success-message .aae-sandbox-title {
    color: #155724;
    font-size: 32px;
    margin-bottom: 15px;
}

.aae-sandbox-success-message .aae-sandbox-description {
    color: #155724;
    font-size: 18px;
    margin-bottom: 25px;
}

.aae-sandbox-success-info {
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    margin-top: 20px;
}

.aae-sandbox-success-info p {
    color: #155724;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 16px;
}

.aae-sandbox-success-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aae-sandbox-success-info li {
    color: #155724;
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    font-size: 15px;
}

.aae-sandbox-success-info li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
    font-size: 16px;
}

.aae-sandbox-auto-login-note {
    margin-top: 20px;
    padding: 15px;
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: 6px;
}

.aae-sandbox-auto-login-note p {
    margin: 0 0 10px 0;
    color: #155724;
    font-size: 14px;
    line-height: 1.4;
}

.aae-sandbox-auto-login-note p:last-child {
    margin-bottom: 0;
}

.aae-sandbox-auto-login-note strong {
    color: #155724;
    font-weight: 600;
}

.aae-sandbox-error-message {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 2px solid #dc3545;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.15);
}

.aae-sandbox-error-message .aae-sandbox-title {
    color: #721c24;
    font-size: 28px;
    margin-bottom: 15px;
}

.aae-sandbox-error-message .aae-sandbox-description {
    color: #721c24;
    font-size: 16px;
    margin-bottom: 20px;
}

.aae-sandbox-retry-link {
    display: inline-block;
    background: #dc3545;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.aae-sandbox-retry-link:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Verification and Site Info */
.aae-verification-info,
.aae-site-info {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #dc3545;
}

/* Login Credentials */
.login-credentials {
    margin: 15px 0;
    padding: 15px;
    background: #e3f2fd;
    border-radius: 6px;
    border-left: 4px solid #2196f3;
}

.login-credentials h5 {
    margin: 0 0 10px 0;
    color: #1976d2;
    font-size: 16px;
    font-weight: 600;
}

.login-credentials p {
    margin: 8px 0;
    color: #333;
    font-family: 'Courier New', monospace;
    background: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.aae-auto-login-btn {
    display: inline-block;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.aae-auto-login-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    color: white;
    text-decoration: none;
}

.aae-verification-info h4,
.aae-site-info h4 {
    margin: 0 0 10px 0;
    color: #333333;
    font-size: 16px;
    font-weight: 600;
}

.aae-verification-info p,
.aae-site-info p {
    margin: 0 0 10px 0;
    color: #666666;
    line-height: 1.5;
}

.aae-verification-info h5,
.aae-site-info h5 {
    margin: 15px 0 8px 0;
    color: #333333;
    font-size: 14px;
    font-weight: 600;
}

.aae-verification-info ul,
.aae-site-info ul {
    margin: 0;
    padding-left: 20px;
    color: #666666;
}

.aae-verification-info li,
.aae-site-info li {
    margin-bottom: 4px;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .aae-sandbox-demo-widget {
        padding: 20px;
        margin: 10px;
    }
    
    .aae-sandbox-title {
        font-size: 24px;
    }
    
    .aae-sandbox-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .aae-sandbox-form-actions {
        flex-direction: column;
    }
    
    .aae-sandbox-cancel,
    .aae-sandbox-submit {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .aae-sandbox-demo-widget {
        padding: 15px;
    }
    
    .aae-sandbox-title {
        font-size: 20px;
    }
    
    .aae-sandbox-form-group input {
        padding: 10px 12px 10px 40px;
        font-size: 14px;
    }
    
    .aae-input-icon {
        left: 12px; /* Adjust for smaller padding on mobile */
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .aae-sandbox-form-group input,
    .aae-sandbox-submit,
    .aae-sandbox-cancel {
        transition: none;
    }
    
    .aae-sandbox-submit.loading .spinner {
        animation: none;
    }
    
    .aae-sandbox-form-group input.error {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .aae-sandbox-form-group input {
        border-width: 3px;
    }
    
    .aae-sandbox-submit {
        border-width: 3px;
    }
}
