body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
}

.navbar-brand {
    font-weight: 600;
}

.card {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15);
}

.card-title {
    color: white;
    font-weight: 700;
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#surveyForm textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #4285f4, #1a73e8);
    border: none;
    font-weight: 600;
    padding: 12px 32px;
    border-radius: 25px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(66, 133, 244, 0.6);
    background: linear-gradient(135deg, #5294f5, #2b7df4);
    border-color: transparent;
    color: white;
}

.btn-primary:active {
    transform: translateY(0px);
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #34a853, #2d8e47);
    border: none;
    font-weight: 600;
    padding: 12px 32px;
    border-radius: 25px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 15px rgba(52, 168, 83, 0.4);
    transition: all 0.3s ease;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 168, 83, 0.6);
    background: linear-gradient(135deg, #45b962, #3ea05a);
    border-color: transparent;
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 600;
    padding: 12px 32px;
    border-radius: 25px;
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    color: white;
}

#surveyPreview {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.question-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.question-number {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-text {
    color: white;
    font-size: 18px;
    font-weight: 500;
    margin-top: 8px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.question-type {
    background: linear-gradient(135deg, #4285f4, #1a73e8);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.required-badge {
    background: linear-gradient(135deg, #ea4335, #d33b27);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

#surveyImage {
    height: 200px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
}

/* Enhanced Loading States */
.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
}

.loading-dots {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 20px;
}

.loading-dots div {
    position: absolute;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4285f4;
    animation: loading-dots 1.2s linear infinite;
}

.loading-dots div:nth-child(1) { left: 8px; animation-delay: 0s; }
.loading-dots div:nth-child(2) { left: 32px; animation-delay: -0.4s; }
.loading-dots div:nth-child(3) { left: 56px; animation-delay: -0.8s; }

@keyframes loading-dots {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.loading-message {
    color: white;
    font-size: 16px;
    font-weight: 500;
    margin-left: 15px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4285f4, #34a853);
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    margin-right: 5px;
}

.alert {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background: rgba(52, 168, 83, 0.2);
    border-color: rgba(52, 168, 83, 0.3);
}

.alert-danger {
    background: rgba(234, 67, 53, 0.2);
    border-color: rgba(234, 67, 53, 0.3);
}

.form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    backdrop-filter: blur(10px);
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #4285f4;
    box-shadow: 0 0 0 0.2rem rgba(66, 133, 244, 0.25);
    color: white;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Add floating labels effect */
.form-label {
    color: white !important;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    transition: all 0.3s ease;
}

/* Modal improvements */
.modal-content {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    color: white;
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-title {
    color: white;
    font-weight: 700;
}

/* Navbar glassmorphism */
.navbar {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Improved list styling */
.question-item ul {
    margin-top: 10px;
    padding-left: 20px;
}

.question-item ul li {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 5px;
    font-size: 14px;
}

/* Better spacing for preview section */
#surveyPreview h3 {
    color: white;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Enhanced card styling for survey preview */
#surveyPreview .card {
    margin-top: 20px;
}

#surveyPreview .card-body {
    padding: 30px;
}

#surveyPreview .card-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

#surveyPreview .card-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Wizard Interface Styling */
.wizard-progress {
    position: relative;
    margin-bottom: 40px;
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wizard-step:not(.active):not(.completed) {
    opacity: 0.5;
}

.wizard-step.active {
    opacity: 1;
    transform: scale(1.1);
}

.wizard-step.completed {
    opacity: 1;
}

.step-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.wizard-step.active .step-icon {
    background: linear-gradient(135deg, #4285f4, #1a73e8);
    border-color: #4285f4;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.4);
}

.wizard-step.completed .step-icon {
    background: linear-gradient(135deg, #34a853, #2d8e47);
    border-color: #34a853;
    box-shadow: 0 4px 15px rgba(52, 168, 83, 0.4);
}

.step-label {
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wizard-progress-line {
    position: absolute;
    top: 25px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 1;
}

.wizard-progress-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #4285f4, #34a853);
    transition: width 0.5s ease;
    width: 0%;
}

.wizard-progress[data-progress="1"] .wizard-progress-line::after { width: 0%; }
.wizard-progress[data-progress="2"] .wizard-progress-line::after { width: 33.33%; }
.wizard-progress[data-progress="3"] .wizard-progress-line::after { width: 66.66%; }
.wizard-progress[data-progress="4"] .wizard-progress-line::after { width: 100%; }

.wizard-content {
    animation: fadeInSlide 0.5s ease-in-out;
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .wizard-nav {
        justify-content: center;
    }
    
    .wizard-nav .btn {
        margin: 5px;
    }
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.publish-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 30px 0;
}

/* Survey Templates Styling */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.template-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

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

.template-card:hover::before {
    left: 100%;
}

.template-card:hover {
    transform: translateY(-5px);
    border-color: #4285f4;
    box-shadow: 0 10px 30px rgba(66, 133, 244, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.template-card.selected {
    border-color: #4285f4;
    box-shadow: 0 0 20px rgba(66, 133, 244, 0.5);
    background: rgba(66, 133, 244, 0.2);
}

.template-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.template-title {
    color: white;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.template-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 0;
}

.divider {
    text-align: center;
    margin: 30px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.divider span {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
}

/* Enhanced Error Handling Styles */
.form-control.is-invalid {
    border-color: #ea4335;
    box-shadow: 0 0 0 0.2rem rgba(234, 67, 53, 0.25);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes fadeInError {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #ea4335;
}

.enhanced-error {
    padding: 20px;
    border-radius: 10px;
    background: rgba(234, 67, 53, 0.1);
    border-left: 4px solid #ea4335;
}

.error-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 10px;
    color: #ea4335;
}

.error-message {
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.error-suggestions {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.suggestions-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #4285f4;
}

.error-suggestions ul {
    margin: 0;
    padding-left: 20px;
}

.error-suggestions li {
    margin-bottom: 5px;
    font-size: 14px;
    line-height: 1.3;
}

.error-actions {
    text-align: center;
    margin-top: 15px;
}

.error-actions .btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    transition: all 0.3s ease;
}

.error-actions .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Enhanced focus indicators */
.template-card:focus {
    outline: 3px solid #4285f4;
    outline-offset: 2px;
    transform: translateY(-5px);
    border-color: #4285f4;
    box-shadow: 0 10px 30px rgba(66, 133, 244, 0.3);
}

.wizard-step:focus {
    outline: 3px solid #4285f4;
    outline-offset: 2px;
}

.btn:focus {
    outline: 3px solid #4285f4;
    outline-offset: 2px;
    box-shadow: 0 0 0 0.2rem rgba(66, 133, 244, 0.25);
}

.form-control:focus {
    outline: 3px solid #4285f4;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid white;
    }
    
    .template-card {
        border: 2px solid white;
    }
    
    .btn-primary {
        background: #0066cc;
        border-color: #0066cc;
    }
    
    .form-control {
        border: 2px solid white;
        background: rgba(0, 0, 0, 0.8);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .template-card::before {
        transition: none;
    }
    
    .template-card:hover::before {
        left: -100%;
    }
}

/* Focus-visible for better keyboard navigation */
.template-card:focus-visible,
.wizard-step:focus-visible,
.btn:focus-visible {
    outline: 3px solid #4285f4;
    outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #4285f4;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 6px;
}