/* Custom styles for the futuristic look and feel */
body {
    font-family: 'Inter', sans-serif;
    background-color: #0a0a0a;
    color: #e0e0e0;
    overflow-x: hidden;
}

/* The canvas for our 3D scene will be fixed in the background */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
    transition: opacity 0.5s ease-out;
}

/* Glassmorphism effect for cards and sections */
.glass-effect {
    background: rgba(16, 16, 16, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Custom gradient text */
.gradient-text {
    background: linear-gradient(90deg, #4f46e5, #db2777);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Scroll-reveal animation */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Project card hover effect */
.project-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.4), 0 0 40px rgba(79, 70, 229, 0.5);
}

/* Typing cursor effect */
.typewriter h1 {
    overflow: hidden;
    border-right: .15em solid #4f46e5;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: .1em;
    animation:
        typing 3.5s steps(30, end) forwards,
        blink-caret .75s step-end infinite;
}

/* The question mark animation is now triggered by a single class and controlled by a CSS variable */
.typewriter.glitch-active h1::after {
    content: '';
    display: inline-block;
    animation: glitch-and-fade 2.5s linear 0s var(--glitch-iterations, 1);
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #4f46e5; }
}

/* Keyframes for the glitching question mark */
@keyframes glitch-and-fade {
    0% { content: ''; }
    10% { content: '?'; transform: none; color: #e0e0e0; }
    50% { content: '?'; transform: none; color: #e0e0e0; }
    51% { content: '▓'; transform: translate(-8px, 2px) skewX(-30deg); color: #db2777; }
    53% { content: '?'; transform: translate(4px, -2px) skewX(20deg); color: #e0e0e0; }
    55% { content: '▒'; transform: translate(6px, 3px) skewX(10deg); color: #4f46e5; }
    57% { content: '?'; transform: translate(-1px, -4px) skewX(-15deg); color: #e0e0e0; }
    60% { content: ''; }
    100% { content: ''; }
}

/* Simple spinner for loading state */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-left-color: #4f46e5;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch.active {
    background: linear-gradient(90deg, #4f46e5, #db2777);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch.active::after {
    transform: translateX(24px);
}

/* File drop zone */
.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #db2777;
    background: rgba(219, 39, 119, 0.1);
}

.drop-zone.has-file {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

/* Tab buttons */
.tab-btn {
    padding: 8px 16px;
    border-radius: 8px;
    background: transparent;
    color: #9ca3af;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: rgba(79, 70, 229, 0.2);
    color: #818cf8;
    border-color: rgba(79, 70, 229, 0.3);
}

.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
}

/* Success animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.success-icon {
    animation: successPulse 0.5s ease;
}
