/* CSS Variables */
:root {
    --bg-primary: #0e0e11;
}

/* Quiz Container - Dark Mode */
.quiz-wrapper {
    min-height: 100vh;
    background: var(--bg-primary);
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
}

.quiz-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(124, 58, 237, 0.10) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.10) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.06) 0%, transparent 50%);
    pointer-events: none;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.quiz-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    background: rgba(18, 22, 31, 0.7);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
    z-index: 1;
}

/* Progress Bar */
.quiz-progress {
    margin-bottom: 3rem;
}

.progress-bar-container {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed 0%, #3b82f6 100%);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.6);
}

.progress-text {
    display: block;
    text-align: center;
    color: #9ca3af;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Quiz Question */
.quiz-question {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.codesona-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.avatar-circle {
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.codesona-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background: #1a1f2e;
    border: 3px solid #1a1f2e;
}

.codesona-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #c4b5fd;
    letter-spacing: 0.3px;
}

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

.chat-bubble {
    flex: 1;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(59, 130, 246, 0.15) 100%);
    border: 2px solid rgba(124, 58, 237, 0.3);
    border-radius: 20px;
    padding: 1.5rem 1.75rem;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.chat-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 20px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 10px 10px 0;
    border-color: transparent rgba(124, 58, 237, 0.3) transparent transparent;
}

.chat-bubble::after {
    content: '';
    position: absolute;
    left: -7px;
    top: 21px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 9px 9px 9px 0;
    border-color: transparent rgba(20, 25, 35, 0.9) transparent transparent;
}

.question-title {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.3;
}

.question-subtext {
    font-size: 1.125rem;
    color: #9ca3af;
    text-align: left;
    margin-bottom: 2rem;
    padding-left: 0;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.option-card {
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(15, 20, 25, 0.6);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: block;
    backdrop-filter: blur(5px);
}

.option-card input[type="radio"],
.option-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.option-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(124, 58, 237, 0.4));
}

.option-text {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #e5e7eb;
    line-height: 1.4;
    text-align: left;
    flex: 1;
}

.option-check {
    position: absolute;
    top: -8px;
    right: -8px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.6);
}

.option-check .material-symbols-outlined {
    font-size: 1.25rem;
    color: white;
}

.option-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
    border-color: var(--option-color, #7c3aed);
    background: rgba(15, 20, 25, 0.8);
}

.option-card:hover .option-icon {
    filter: drop-shadow(0 0 15px rgba(124, 58, 237, 0.6));
    transform: scale(1.05);
}

.option-card.selected {
    border-color: var(--option-color, #7c3aed);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
}

.option-card.selected .option-check {
    opacity: 1;
    transform: scale(1);
}

.option-card.selected .option-text {
    color: var(--option-color, #c4b5fd);
    font-weight: 700;
}

.option-card.selected .option-icon {
    filter: drop-shadow(0 0 25px rgba(124, 58, 237, 0.8));
}

/* Freeform Input */
.freeform-section {
    margin-top: 3rem;
    width: 100%;
}

.freeform-divider {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

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

.freeform-divider span {
    position: relative;
    background: rgba(18, 22, 31, 0.97);
    padding: 0 1.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: lowercase;
    font-style: italic;
}

.freeform-input {
    width: 100%;
    min-height: 100px;
    padding: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s;
    background: rgba(15, 20, 25, 0.6);
    color: #e5e7eb;
}

.freeform-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.2);
    background: rgba(15, 20, 25, 0.8);
}

.freeform-input::placeholder {
    color: #6b7280;
}

.freeform-input.invalid {
    border-color: rgba(239, 68, 68, 0.5);
}

.freeform-input.invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

/* Freeform Counter */
.freeform-counter {
    margin-top: 0.5rem;
    text-align: right;
    min-height: 20px;
}

.counter-text {
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.counter-warning {
    color: #fbbf24;
}

.counter-error {
    color: #fca5a5;
}

.counter-success {
    color: #34d399;
}

.counter-neutral {
    color: #9ca3af;
}

/* Navigation Buttons */
.quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    gap: 1rem;
}

.quiz-navigation.center-content {
    justify-content: center;
}

#nextBtn {
    margin-left: auto;
}

.quiz-navigation .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s;
    cursor: pointer;
}

.quiz-navigation .btn-primary {
    background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
    color: white;
    border: none;
}

.quiz-navigation .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.5);
}

.quiz-navigation .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.quiz-navigation .btn-secondary {
    background: rgba(55, 65, 81, 0.8);
    color: #e5e7eb;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.quiz-navigation .btn-secondary:hover {
    background: rgba(75, 85, 99, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-finish {
    font-size: 1.125rem;
    padding: 1rem 2.5rem;
}

.btn-finish.w-100 {
    width: 100% !important;
}

/* Start Over Link */
.start-over-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #9ca3af;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.start-over-link:hover {
    color: #c4b5fd;
    opacity: 1;
    text-decoration: none;
}

.start-over-link i {
    transition: transform 0.3s ease;
}

.start-over-link:hover i {
    transform: rotate(-180deg);
}

/* Register Modal */
.quiz-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: rgba(18, 22, 31, 0.97);
    padding: 3rem;
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #9ca3af;
    padding: 0;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e5e7eb;
    transform: rotate(90deg);
}

.modal-close .material-symbols-outlined {
    font-size: 24px;
}

.modal-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-align: center;
}

.modal-subtitle {
    color: #9ca3af;
    text-align: center;
    margin-bottom: 2rem;
}

.register-form .form-group {
    margin-bottom: 1.5rem;
}

.register-form label {
    display: block;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 0.5rem;
}

.register-form .form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    background: rgba(15, 20, 25, 0.6);
    color: #e5e7eb;
}

.register-form .form-control:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.2);
    background: rgba(15, 20, 25, 0.8);
}

.register-form .form-control::placeholder {
    color: #6b7280;
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 1rem;
}

.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

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

.divider span {
    position: relative;
    background: rgba(18, 22, 31, 0.97);
    padding: 0 1rem;
    color: #9ca3af;
    font-size: 0.875rem;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: white;
    color: #333;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 0.875rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-google:hover {
    background: #f5f7fa;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Persona Reveal */
.persona-reveal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 2rem;
}

.persona-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 50% 50%, rgba(124, 58, 237, 0.2) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.persona-card-reveal {
    background: rgba(18, 22, 31, 0.97);
    padding: 3rem;
    border-radius: 24px;
    text-align: center;
    max-width: 600px;
    width: 100%;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1;
}

.persona-card-reveal.animate-in {
    opacity: 1;
    transform: scale(1);
}

.persona-icon-wrapper {
    margin-bottom: 2rem;
}

.persona-icon-large {
    width: 120px;
    height: 120px;
    object-fit: contain;
    animation: bounceIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
    filter: drop-shadow(0 0 30px rgba(124, 58, 237, 0.8));
}

.persona-name {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.persona-description {
    font-size: 1.25rem;
    color: #9ca3af;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.traits-container {
    margin-bottom: 2.5rem;
    text-align: left;
}

.traits-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 1.5rem;
    text-align: center;
}

.trait-item {
    margin-bottom: 1.25rem;
}

.trait-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.trait-name {
    font-weight: 600;
    color: #e5e7eb;
}

.trait-value {
    font-weight: 700;
    color: #c4b5fd;
}

.trait-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.trait-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed 0%, #3b82f6 100%);
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s;
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.6);
}

.btn-dashboard {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.rotating {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .quiz-wrapper {
        padding: 1rem 0.75rem;
    }
    
    .quiz-container {
        padding: 1.25rem;
    }
    
    .question-header {
        gap: 0.75rem;
        margin-bottom: 2rem;
    }
    
    .codesona-profile {
        gap: 0.375rem;
    }
    
    .avatar-circle {
        width: 62px;
        height: 62px;
    }
    
    .codesona-avatar {
    }
    
    .codesona-name {
        font-size: 0.65rem;
    }
    
    .chat-bubble {
        padding: 1.25rem 1.5rem;
        border-radius: 16px;
    }
    
    .chat-bubble::before {
        left: -8px;
        top: 16px;
        border-width: 8px 8px 8px 0;
    }
    
    .chat-bubble::after {
        left: -6px;
        top: 17px;
        border-width: 7px 7px 7px 0;
    }
    
    .question-title {
        font-size: 1.25rem;
    }
    
    .question-subtext {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: 0.625rem;
        margin-top: 1.25rem;
    }
    
    .option-card {
        padding: 0.75rem 0.875rem;
    }
    
    .option-icon {
        width: 28px;
        height: 28px;
    }
    
    .option-text {
        font-size: 0.875rem;
    }
    
    .option-check {
        width: 28px;
        height: 28px;
        top: -6px;
        right: -6px;
    }
    
    .option-check .material-symbols-outlined {
        font-size: 1.125rem;
    }
    
    .quiz-navigation {
        margin-top: 2rem;
        gap: 0.75rem;
    }
    
    .quiz-navigation .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9375rem;
    }
    
    .btn-finish {
        font-size: 1rem;
        padding: 0.875rem 2rem;
    }
    
    .freeform-section {
        margin-top: 2rem;
    }
    
    .freeform-input {
        min-height: 80px;
        padding: 1rem;
        font-size: 0.9375rem;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-subtitle {
        font-size: 0.9375rem;
    }
    
    .persona-card-reveal {
        padding: 1.5rem;
    }
    
    .persona-icon-large {
        width: 90px;
        height: 90px;
    }
    
    .persona-name {
        font-size: 1.75rem;
    }
    
    .persona-description {
        font-size: 1.0625rem;
    }
}

@media (max-width: 480px) {
    .quiz-wrapper {
        padding: 0.75rem 0.5rem;
    }
    
    .quiz-container {
        padding: 1rem;
        border-radius: 16px;
    }
    
    .question-header {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    .codesona-profile {
        gap: 0.25rem;
    }
    
    .avatar-circle {
        width: 52px;
        height: 52px;
    }
    
    .codesona-avatar {
    }
    
    .codesona-name {
        font-size: 0.625rem;
    }
    
    .chat-bubble {
        padding: 1rem 1.25rem;
        border-radius: 14px;
    }
    
    .chat-bubble::before {
        left: -7px;
        top: 14px;
        border-width: 7px 7px 7px 0;
    }
    
    .chat-bubble::after {
        left: -5px;
        top: 15px;
        border-width: 6px 6px 6px 0;
    }
    
    .question-title {
        font-size: 1.0625rem;
    }
    
    .question-subtext {
        font-size: 0.9375rem;
        margin-bottom: 1.25rem;
    }
    
    .options-grid {
        gap: 0.5rem;
    }
    
    .option-card {
        padding: 0.625rem 0.75rem;
        border-radius: 8px;
    }
    
    .option-icon {
        width: 24px;
        height: 24px;
    }
    
    .option-text {
        font-size: 0.8125rem;
    }
    
    .quiz-navigation .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .btn-finish {
        font-size: 0.9375rem;
        padding: 0.75rem 1.5rem;
    }
    
    .modal-content {
        padding: 1.25rem;
        border-radius: 16px;
    }
    
    .modal-title {
        font-size: 1.375rem;
    }
    
    .persona-card-reveal {
        padding: 1.25rem;
    }
    
    .persona-icon-large {
        width: 70px;
        height: 70px;
    }
    
    .persona-name {
        font-size: 1.5rem;
    }
    
    .persona-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
}
