/* Personality Quiz Frontend Styles */

/* Container */
.pq-quiz-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Heading */
.pq-quiz-heading {
    text-align: center;
    font-size: 28px;
    color: #333;
    margin-bottom: 40px;
    font-weight: 600;
}

/* Phase Management */
.pq-phase {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.pq-phase-active {
    display: block;
    opacity: 1;
}

/* Words Grid */
.pq-words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.pq-word {
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 15px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
    user-select: none;
}

.pq-word:hover {
    background: #e8e8e8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.pq-word.pq-selected {
    background: #4CAF50;
    color: white;
    border-color: #45a049;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Counter */
.pq-counter-wrapper {
    text-align: center;
    margin: 30px 0;
}

.pq-selection-counter {
    font-size: 20px;
    font-weight: 600;
    color: #555;
}

#pq-selected-count {
    color: #4CAF50;
    font-size: 24px;
}

/* Submit Section */
.pq-submit-section {
    text-align: center;
    margin-top: 30px;
    transition: all 0.4s ease;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

.pq-submit-section.pq-visible {
    max-height: 200px;
    opacity: 1;
}

.pq-hidden {
    display: none;
}

.pq-email-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

#pq-email-input {
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    min-width: 280px;
    transition: border-color 0.3s ease;
}

#pq-email-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.pq-submit-button {
    padding: 12px 40px;
    font-size: 16px;
    font-weight: 600;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pq-submit-button:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.pq-submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.pq-error-message {
    color: #f44336;
    margin-top: 10px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pq-error-message.pq-visible {
    opacity: 1;
}

/* Results Phase */
.pq-columns-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 40px;
    position: relative;
}

@media (max-width: 768px) {
    .pq-columns-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .pq-columns-container {
        grid-template-columns: 1fr;
    }
}

.pq-column {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    min-height: 300px;
    position: relative;
    transition: all 0.5s ease;
}

.pq-column-count {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
    position: relative;
}

.pq-column-heading {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pq-column-words {
    margin-top: 20px;
}

.pq-column-word {
    background: white;
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 6px;
    font-size: 14px;
    opacity: 0;
    animation: fadeInWord 0.3s ease forwards;
}

@keyframes fadeInWord {
    to {
        opacity: 1;
    }
}

/* Column Colors */
.pq-column-red {
    border: 3px solid #f44336;
}

.pq-column-red .pq-column-count,
.pq-column-red .pq-column-heading {
    color: #f44336;
}

.pq-column-yellow {
    border: 3px solid #FFC107;
}

.pq-column-yellow .pq-column-count,
.pq-column-yellow .pq-column-heading {
    color: #F57F17;
}

.pq-column-green {
    border: 3px solid #4CAF50;
}

.pq-column-green .pq-column-count,
.pq-column-green .pq-column-heading {
    color: #4CAF50;
}

.pq-column-blue {
    border: 3px solid #2196F3;
}

.pq-column-blue .pq-column-count,
.pq-column-blue .pq-column-heading {
    color: #2196F3;
}

/* Winner Animation */
.pq-column.pq-winner {
    animation: pulseWinner 0.6s ease;
    border-width: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

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

.pq-column.pq-tie {
    animation: shakeTie 0.5s ease;
}

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

/* Star Animation */
.pq-star {
    position: absolute;
    font-size: 24px;
    color: #FFD700;
    animation: starExplode 2s ease-out forwards;
    pointer-events: none;
}

@keyframes starExplode {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(0);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--x), var(--y)) rotate(var(--rotation)) scale(1);
        opacity: 0;
    }
}

/* Question Mark Animation */
.pq-question {
    position: absolute;
    font-size: 24px;
    color: #9C27B0;
    font-weight: 700;
    animation: questionExplode 2s ease-out forwards;
    pointer-events: none;
}

@keyframes questionExplode {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(0);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--x), var(--y)) rotate(var(--rotation)) scale(1);
        opacity: 0;
    }
}

/* Modal */
.pq-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pq-modal.pq-modal-active {
    display: flex;
    opacity: 1;
}

.pq-modal-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.4s ease;
}

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

.pq-modal-image-wrapper {
    text-align: center;
    margin-bottom: 20px;
}

#pq-modal-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

#pq-modal-heading {
    font-size: 32px;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

#pq-modal-subheading {
    font-size: 20px;
    color: #666;
    margin-bottom: 20px;
    text-align: center;
}

#pq-modal-body {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 30px;
}

.pq-modal-close {
    display: block;
    margin: 0 auto;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: 600;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pq-modal-close:hover {
    background: #45a049;
    transform: translateY(-2px);
}

/* Word Animation */
.pq-word-animating {
    z-index: 1000;
    pointer-events: none;
}

/* Confetti Canvas */
#pq-confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
