@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #6A0DAD 0%, #8A2BE2 25%, #9370DB 50%, #8A2BE2 75%, #6A0DAD 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 0;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Page Visibility Control - UPDATED */
.page {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.page.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.6s ease;
}

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

/* Form Step Visibility */
.form-step {
    display: none;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.5s ease;
}

.form-step.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Glass Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

.btn-purple {
    background: linear-gradient(135deg, #6A0DAD, #8A2BE2);
    transition: all 0.3s ease;
}

.btn-purple:hover {
    background: linear-gradient(135deg, #8A2BE2, #6A0DAD);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(138, 43, 226, 0.4);
}

.progress-bar {
    transition: width 0.5s ease;
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    animation: twinkle linear infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

.success-checkmark {
    animation: scaleUp 0.5s ease;
}

@keyframes scaleUp {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #ffffff;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

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

/* FORM STYLING */
input[type="text"], 
input[type="number"], 
input[type="email"],
input[type="url"],
select, 
textarea {
    width: 100% !important;
    padding: 1rem !important;
    border-radius: 0.75rem !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    font-size: 1rem !important;
    min-height: 3.5rem !important;
    transition: all 0.3s ease !important;
}

input[type="text"]:focus, 
input[type="number"]:focus, 
input[type="email"]:focus,
input[type="url"]:focus,
select:focus, 
textarea:focus {
    outline: none !important;
    border-color: rgba(147, 51, 234, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.2) !important;
}

input::placeholder, 
textarea::placeholder {
    color: rgb(196, 181, 253) !important;
    opacity: 0.7 !important;
}

select option {
    background: #6A0DAD !important;
    color: white !important;
    padding: 0.5rem !important;
}

textarea {
    min-height: 6rem !important;
    resize: vertical !important;
}

textarea.h-24 {
    min-height: 6rem !important;
}

textarea.h-32 {
    min-height: 8rem !important;
}

input[type="checkbox"], input[type="radio"] {
    accent-color: #8A2BE2;
    width: 1.25rem !important;
    height: 1.25rem !important;
    cursor: pointer;
}

.conditional-field {
    display: none;
    opacity: 0;
    margin-top: 1rem;
    transition: opacity 0.3s ease;
}

.conditional-field.show,
.conditional-field.active {
    display: block;
    opacity: 1;
}

.yes-no-container {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 3rem;
    flex: 1;
    min-width: 120px;
}

.radio-option:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.radio-option input[type="radio"] {
    cursor: pointer;
}

.radio-option label {
    cursor: pointer;
    margin: 0 !important;
}

.radio-option input[type="radio"]:checked ~ label,
.radio-option:has(input[type="radio"]:checked) label {
    color: #fff !important;
    font-weight: 600 !important;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 3rem;
}

.checkbox-option:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.checkbox-option input[type="checkbox"] {
    cursor: pointer;
}

.checkbox-option label {
    cursor: pointer;
    margin: 0 !important;
}

.checkbox-option input[type="checkbox"]:checked ~ label,
.checkbox-option:has(input[type="checkbox"]:checked) label {
    color: #fff !important;
    font-weight: 600 !important;
}

label {
    display: block;
    color: white !important;
    margin-bottom: 0.5rem !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
}

.space-y-4 > * + * {
    margin-top: 1rem !important;
}

.space-y-6 > * + * {
    margin-top: 1.5rem !important;
}

/* Blacklist warning styles */
.blacklist-warning {
    display: none;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    color: #fca5a5;
    font-size: 0.875rem;
    animation: warningSlideIn 0.3s ease-out;
}

.blacklist-warning.show {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blacklist-warning i {
    color: #ef4444;
    font-size: 1rem;
}

@keyframes warningSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Field error state for blacklisted words */
.field-blacklist-error {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.05) !important;
    animation: pulseRed 1s ease-in-out;
}

@keyframes pulseRed {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* Disabled state for navigation buttons when blacklist detected */
.btn-disabled {
    background: rgba(107, 114, 128, 0.5) !important;
    color: rgba(156, 163, 175, 0.8) !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    opacity: 0.6 !important;
}

/* Blacklist modal overlay - UPDATED */
.blacklist-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.blacklist-modal-overlay.show,
.blacklist-modal-overlay.active {
    display: flex;
}

.blacklist-modal {
    background: linear-gradient(135deg, #6A0DAD 0%, #8A2BE2 50%, #6A0DAD 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 1.5rem;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.blacklist-modal h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.blacklist-modal h3 i {
    color: #fca5a5;
    font-size: 1.5rem;
}

.blacklist-modal p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    font-size: 0.95rem;
}

.blacklist-modal button {
    background: rgba(255, 255, 255, 0.9);
    color: #6A0DAD;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.blacklist-modal button:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

/* Highlight blacklisted words in text */
.blacklist-highlight {
    background: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 0.1rem 0.2rem;
    border-radius: 0.25rem;
    text-decoration: underline;
    text-decoration-color: #ef4444;
}

/* Menu Button Styles */
.menu-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: linear-gradient(135deg, #6A0DAD, #8A2BE2);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    width: 50px;
    height: 50px;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
}

.menu-button.show {
    display: flex;
}

.menu-button:hover {
    background: linear-gradient(135deg, #8A2BE2, #6A0DAD);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.5);
}

.menu-button i {
    color: white;
    font-size: 20px;
}

/* Sidebar Styles */
.user-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: linear-gradient(180deg, #6A0DAD 0%, #8A2BE2 50%, #6A0DAD 100%);
    backdrop-filter: blur(15px);
    border-right: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 1002;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.3);
}

.user-sidebar.active {
    left: 0;
}

.sidebar-content {
    padding: 80px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* User Avatar */
.user-avatar-container {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
}

.user-avatar-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.status-dot {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid #6A0DAD;
    background-color: #43b581;
}

/* User Info */
.user-info {
    text-align: center;
}

.user-name {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.user-status {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    text-transform: capitalize;
}

/* Divider */
.sidebar-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    margin: 10px 0;
}

/* Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.sidebar-link i {
    font-size: 18px;
    width: 20px;
}

/* Logout Button */
.logout-button {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.logout-button:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.logout-button i {
    font-size: 18px;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1000;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* Back Button Styles */
.back-btn,
.back-step {
    background: transparent;
    border: none;
    color: rgb(196, 181, 253);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
}

.back-btn:hover,
.back-step:hover {
    color: white;
}

/* Review Button */
.review-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .user-sidebar {
        width: 280px;
        left: -280px;
    }

    .menu-button {
        width: 45px;
        height: 45px;
        top: 15px;
        left: 15px;
    }

    .menu-button i {
        font-size: 18px;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .yes-no-container {
        flex-direction: column;
    }

    .radio-option {
        min-width: 100%;
    }
}

@media (max-width: 640px) {
    body {
        padding: 1rem;
    }

    .glass-effect {
        padding: 1.5rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    .btn-purple {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.9rem !important;
    }
}
