/**
 * Sandboxera Frontend CSS - Modern Fancy Design
 */

/* Sandboxera Demo Form Styles */

/* Base Card Styles */
.sandboxera-demo-card {
    max-width: 480px;
    margin: 0 auto;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

/* Card Header */
.sandboxera-card-header {
    text-align: center;
    margin-bottom: 32px;
}

.sandboxera-card-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.2);
}

.sandboxera-card-title {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.sandboxera-card-subtitle {
    font-size: 16px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Form Styles */
.sandboxera-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sandboxera-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sandboxera-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.sandboxera-label svg {
    color: #6b7280;
}

.sandboxera-input {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    color: #1f2937;
    transition: all 0.2s ease;
    font-family: inherit;
}

.sandboxera-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.sandboxera-input::placeholder {
    color: #9ca3af;
}

/* Submit Button */
.sandboxera-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
}

.sandboxera-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(102, 126, 234, 0.3);
}

.sandboxera-submit-btn:active {
    transform: translateY(0);
}

.sandboxera-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.sandboxera-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sandboxera-btn-icon svg {
    transition: transform 0.2s ease;
}

.sandboxera-submit-btn:hover .sandboxera-btn-icon svg {
    transform: translateX(2px);
}

/* Message Styles */
.sandboxera-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    margin-top: 16px;
    display: none;
}

.sandboxera-message.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    display: block;
}

.sandboxera-message.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    display: block;
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    .sandboxera-demo-card {
        margin: 16px;
        padding: 24px;
        border-radius: 12px;
    }
    
    .sandboxera-card-title {
        font-size: 24px;
    }
    
    .sandboxera-card-subtitle {
        font-size: 14px;
    }
    
    .sandboxera-card-icon {
        width: 56px;
        height: 56px;
    }
}

/* Handle empty elements gracefully */
.sandboxera-card-header:empty {
    display: none;
}

.sandboxera-card-title:empty,
.sandboxera-card-subtitle:empty,
.sandboxera-label:empty,
.sandboxera-btn-text:empty {
    display: none;
}

/* Adjust spacing when elements are hidden */
.sandboxera-card-header:not(:has(.sandboxera-card-title)):not(:has(.sandboxera-card-subtitle)) {
    margin-bottom: 0;
}

.sandboxera-form-group:not(:has(.sandboxera-label)) {
    margin-top: 0;
}

.sandboxera-submit-btn:not(:has(.sandboxera-btn-text)) {
    padding: 12px 16px;
}

/* Ensure proper spacing when only icon is present */
.sandboxera-submit-btn:has(.sandboxera-btn-icon):not(:has(.sandboxera-btn-text)) {
    min-width: 48px;
    justify-content: center;
    padding: 12px 16px;
}

/* Fallback for browsers that don't support :has() */
.sandboxera-submit-btn.sandboxera-icon-only {
    min-width: 48px;
    justify-content: center;
    padding: 12px 16px;
}

/* Hide empty card header completely */
.sandboxera-card-header:not(:has(.sandboxera-card-title)):not(:has(.sandboxera-card-subtitle)) {
    display: none;
}

/* Adjust form spacing when header is hidden or doesn't exist */
.sandboxera-demo-card:not(:has(.sandboxera-card-header)) .sandboxera-form,
.sandboxera-demo-card .sandboxera-form:first-child {
    margin-top: 0;
}

/* Handle empty placeholder text - maintain input styling */
.sandboxera-input {
    /* Input styling is already defined above */
}

/* Ensure proper spacing when labels are hidden */
.sandboxera-form-group:not(:has(.sandboxera-label)) .sandboxera-input {
    margin-top: 0;
}

/* Additional spacing adjustments for better UX */
.sandboxera-demo-card:not(:has(.sandboxera-card-header)) {
    padding-top: 0;
}

.sandboxera-form:first-child {
    margin-top: 0;
}

/* Fallback classes for better browser compatibility */
.sandboxera-no-header .sandboxera-form {
    margin-top: 0;
}

.sandboxera-no-header {
    padding-top: 0;
}

.sandboxera-no-label .sandboxera-input {
    margin-top: 0;
}

/* Ensure proper button styling when text is empty */
.sandboxera-submit-btn:has(.sandboxera-btn-icon):not(:has(.sandboxera-btn-text)) {
    min-width: 48px;
    justify-content: center;
    padding: 12px 16px;
}

/* Loading Overlay */
.sandboxera-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    backdrop-filter: blur(10px);
}

.sandboxera-loading-content {
    text-align: center;
    color: white;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.1);
    padding: 3rem 2rem;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sandboxera-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #7256b2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.sandboxera-loading-text {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.sandboxera-loading-subtext {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.sandboxera-progress-container {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin: 0 auto;
    overflow: hidden;
}

.sandboxera-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 200% 100%;
    animation: gradientShift 2s ease-in-out infinite;
    transition: width 0.3s ease;
    border-radius: 4px;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Enhanced entrance animation */
.sandboxera-demo-card.animate-in {
    animation: slideInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Spinning icon animation */
.sandboxera-btn-icon.spinning {
    animation: spin 1s linear infinite;
}

/* Focus states for form groups */
.sandboxera-form-group.focused .sandboxera-label {
    color: #4ade80;
}

.sandboxera-form-group.focused .sandboxera-label svg {
    color: #4ade80;
}

/* Error states for inputs */
.sandboxera-input.error {
    border-color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
}

.error-message {
    color: #f87171;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Enhanced hover effects */
.sandboxera-input:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

/* Enhanced message animations */
.sandboxera-message {
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced loading overlay */
.sandboxera-loading-overlay {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.sandboxera-loading-content {
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Enhanced card shadow on hover */
.sandboxera-demo-card:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Enhanced focus states for accessibility */
.sandboxera-submit-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.3);
}

.sandboxera-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .sandboxera-demo-card {
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sandboxera-demo-card {
        border: 2px solid white;
    }
    
    .sandboxera-input {
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
    
    .sandboxera-submit-btn {
        border: 2px solid white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .sandboxera-demo-card,
    .sandboxera-input,
    .sandboxera-submit-btn,
    .sandboxera-message {
        animation: none;
        transition: none;
    }
    
    .sandboxera-submit-btn:hover,
    .sandboxera-input:hover {
        transform: none;
    }
    
    .sandboxera-btn-icon {
        transition: none;
    }
    
    .sandboxera-submit-btn:hover .sandboxera-btn-icon {
        transform: none;
    }
}

/* Terms Checkbox Styles */
.sandboxera-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.8;
    color: #374151;
    margin: 0;
    padding: 0;
}

.sandboxera-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.sandboxera-checkbox-custom {
    position: relative;
    height: 20px;
    width: 20px;
    background-color: white;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s ease;
}

.sandboxera-checkbox:checked + .sandboxera-checkbox-custom {
    background-color: #667eea;
    border-color: #667eea;
}

.sandboxera-checkbox:checked + .sandboxera-checkbox-custom::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.sandboxera-checkbox:focus + .sandboxera-checkbox-custom {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.sandboxera-checkbox-text {
    flex: 1;
    color: #374151;
}

.sandboxera-checkbox-text a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.sandboxera-checkbox-text a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

.sandboxera-checkbox-text a:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Checkbox hover effect */
.sandboxera-checkbox-label:hover .sandboxera-checkbox-custom {
    border-color: #9ca3af;
}

.sandboxera-checkbox-label:hover .sandboxera-checkbox:checked + .sandboxera-checkbox-custom {
    background-color: #5a67d8;
    border-color: #5a67d8;
}

/* Error state for checkbox */
.sandboxera-checkbox.error + .sandboxera-checkbox-custom {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Responsive checkbox */
@media (max-width: 640px) {
    .sandboxera-checkbox-label {
        font-size: 13px;
        gap: 10px;
    }
    
    .sandboxera-checkbox-custom {
        height: 18px;
        width: 18px;
        margin-top: 1px;
    }
    
    .sandboxera-checkbox:checked + .sandboxera-checkbox-custom::after {
        left: 5px;
        top: 1px;
        width: 5px;
        height: 9px;
    }
}

/* Hide logo option */
.sandboxera-hide-logo .sandboxera-card-icon {
    display: none !important;
}

.sandboxera-hide-logo .sandboxera-card-header {
    margin-bottom: 24px;
} 