/* Magic.css - Styling for the digital illusions page */

.magic-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #0a0a1a;
    color: #e0e0ff;
    font-family: 'Montserrat', sans-serif;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

.magic-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(50, 50, 150, 0.2) 0%, rgba(10, 10, 26, 0.5) 100%);
    pointer-events: none;
    z-index: 1;
}

.magic-title {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #8a2be2, #4169e1, #00bfff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
    position: relative;
    z-index: 2;
    animation: titleGlow 3s infinite alternate;
}

@keyframes titleGlow {
    0% { text-shadow: 0 0 15px rgba(138, 43, 226, 0.5); }
    100% { text-shadow: 0 0 30px rgba(65, 105, 225, 0.8); }
}

.magic-intro {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 3rem;
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 2;
}

.magic-section {
    margin-bottom: 5rem;
    padding: 2rem;
    border-radius: 10px;
    background: rgba(20, 20, 40, 0.7);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
    position: relative;
    z-index: 2;
    transition: all 0.5s ease;
    transform: translateY(50px);
    opacity: 0;
    animation: sectionAppear 0.8s forwards;
    animation-delay: calc(var(--section-index, 0) * 0.2s);
}

@keyframes sectionAppear {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.magic-section:nth-child(2) { --section-index: 1; }
.magic-section:nth-child(3) { --section-index: 2; }
.magic-section:nth-child(4) { --section-index: 3; }
.magic-section:nth-child(5) { --section-index: 4; }
.magic-section:nth-child(6) { --section-index: 5; }
.magic-section:nth-child(7) { --section-index: 6; }

.magic-section:hover {
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.5);
    transform: scale(1.01);
}

.magic-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #a0a0ff;
    text-align: center;
    position: relative;
}

.magic-section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #a0a0ff, transparent);
}

.magic-trick {
    padding: 1.5rem;
    border-radius: 8px;
    background: rgba(30, 30, 60, 0.6);
    margin-bottom: 2rem;
}

.magic-trick p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.magic-trick ol, .magic-trick ul {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.magic-trick li {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.magic-button {
    display: block;
    margin: 2rem auto;
    padding: 12px 24px;
    background: linear-gradient(45deg, #8a2be2, #4169e1);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
    position: relative;
    overflow: hidden;
}

.magic-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s;
}

.magic-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(138, 43, 226, 0.7);
}

.magic-button:hover::before {
    opacity: 1;
    animation: buttonGlow 1.5s infinite;
}

@keyframes buttonGlow {
    0% { transform: rotate(45deg) translateY(0); opacity: 0; }
    50% { opacity: 0.3; }
    100% { transform: rotate(45deg) translateY(-100px); opacity: 0; }
}

.magic-result {
    text-align: center;
    font-size: 1.5rem;
    height: 0;
    overflow: hidden;
    transition: all 0.8s ease;
    opacity: 0;
}

.magic-result.reveal {
    height: auto;
    opacity: 1;
    padding: 2rem;
    margin-top: 1rem;
    background: rgba(40, 40, 80, 0.6);
    border-radius: 8px;
    animation: resultReveal 1s forwards;
}

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

.prediction-highlight {
    color: #ffcc00;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.explanation-hidden {
    font-size: 0.9rem;
    color: #a0a0ff;
    opacity: 0;
    transition: opacity 2s ease;
    margin-top: 1rem;
}

.reveal .explanation-hidden {
    opacity: 1;
    transition-delay: 3s;
}

/* Memory Matrix styling */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 2rem auto;
    max-width: 300px;
}

.memory-cell {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(50, 50, 100, 0.3);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.memory-cell.highlight {
    background: rgba(138, 43, 226, 0.8);
    transform: scale(1.1);
}

.memory-cell.user-click {
    background: rgba(65, 105, 225, 0.8);
}

.level-indicator {
    text-align: center;
    font-size: 1.2rem;
    margin-top: 1rem;
    color: #a0a0ff;
}

/* Word list styling */
.word-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 1.5rem 0;
}

.word-list span {
    padding: 8px 15px;
    background: rgba(50, 50, 100, 0.4);
    border-radius: 20px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.word-list span:hover {
    background: rgba(70, 70, 140, 0.6);
    transform: scale(1.1);
}

/* Hypnotic Spiral */
.spiral-container {
    width: 300px;
    height: 300px;
    margin: 2rem auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spiral {
    width: 100%;
    height: 100%;
}

.spiral svg {
    width: 100%;
    height: 100%;
}

.spiral-timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: white;
    z-index: 10;
    display: none;
}

/* Moving Illusion */
.illusion-container {
    width: 400px;
    height: 400px;
    margin: 2rem auto;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.illusion-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.illusion-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(10, 10, 26, 0.5) 100%);
    pointer-events: none;
}

/* Color illusion styling */
.color-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 2rem auto;
    max-width: 300px;
}

.color-cell {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 5px;
}

.color-timer {
    text-align: center;
    font-size: 2rem;
    margin-top: 1rem;
    color: #a0a0ff;
}

.white-area {
    background-color: white;
    color: black;
    padding: 3rem;
    border-radius: 8px;
    text-align: center;
    margin: 2rem auto;
    max-width: 400px;
}

/* Vanishing Dot */
.dot-illusion {
    position: relative;
    height: 300px;
    background-color: #111;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.dot-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.center-cross {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: white;
}

.colored-dot {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.dot1 {
    top: 30%;
    left: 30%;
    background-color: #ff5555;
    animation: pulse 2s infinite;
}

.dot2 {
    top: 30%;
    right: 30%;
    background-color: #55ff55;
    animation: pulse 2s infinite 0.5s;
}

.dot3 {
    bottom: 30%;
    left: 30%;
    background-color: #5555ff;
    animation: pulse 2s infinite 1s;
}

.dot4 {
    bottom: 30%;
    right: 30%;
    background-color: #ffff55;
    animation: pulse 2s infinite 1.5s;
}

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

/* Magic particles for cursor effect */
.magic-particle {
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    z-index: 9999;
    transition: transform 1s ease-out, opacity 1s ease-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .magic-title {
        font-size: 3rem;
    }
    
    .magic-section h2 {
        font-size: 2rem;
    }
    
    .illusion-container,
    .spiral-container {
        width: 100%;
        max-width: 300px;
        height: auto;
    }
}

@media (max-width: 480px) {
    .magic-title {
        font-size: 2.5rem;
    }
    
    .magic-section h2 {
        font-size: 1.8rem;
    }
}
