/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    overflow: hidden; /* Prevent scrolling during intro */
    background: url('bg2_empty.png') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
}

/* Intro Screen */
.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 1s ease-in-out;
    overflow: hidden;
}

.intro-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1001;
}



.intro-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.intro-content {
    text-align: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    background: rgba(0, 0, 0, 0.3);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    z-index: 1002;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.intro-content.show {
    opacity: 1;
}

/* Loading Bar */
.loading-bar-container {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    z-index: 1003;
    text-align: center;
}

.loading-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 15px;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #a855f7, #c084fc, #8b5cf6);
    background-size: 200% 100%;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease-out;
    animation: gradient-shift 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
}

.loading-text {
    color: #8b5cf6;
    font-size: 0.9rem;
    font-weight: 500;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    letter-spacing: 1px;
    text-transform: lowercase;
}

.loading-dots {
    animation: dots-animation 1.5s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes dots-animation {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60% { content: "..."; }
    80%, 100% { content: ""; }
}

.intro-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient 3s ease infinite;
}

.intro-subtitle {
    font-size: 1.3rem;
    margin-bottom: 30px;
    opacity: 0.9;
    font-weight: 300;
}

.intro-wizard {
    font-size: 4rem;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

/* Main App */
.container {
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fadeInMain 1.5s ease-in-out forwards;
    animation-delay: 0.5s;
}

@keyframes fadeInMain {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    opacity: 0;
    animation: fadeInHeader 1s ease-in-out forwards;
    animation-delay: 1s;
    position: relative;
}

@keyframes fadeInHeader {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-bottom: 10px;
    width: 100%;
}

.logo h1 {
    text-align: center;
    margin: 0;
}

.wizard-icon {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    animation: float 3s ease-in-out infinite;
    object-fit: contain;
    margin: 0;
    flex-shrink: 0;
}

.wizard-left {
    animation-delay: 0s;
    margin-right: 4px;
}

.wizard-right {
    animation-delay: 1.5s;
    margin-left: 40px;
}

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

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Fredoka', cursive;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #e3d44e, #ba2d35, #e0d6ca);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient 6s ease-in-out infinite;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

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

/* Language Control */
.language-control {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000;
}

.language-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 60px;
    position: relative;
    overflow: hidden;
}

.language-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.language-btn:hover::before {
    left: 100%;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.language-btn.turkish {
    background: rgba(139, 69, 19, 0.2);
    border-color: rgba(139, 69, 19, 0.5);
    animation: languagePulse 2s ease-in-out infinite;
}

.language-btn.turkish:hover {
    background: rgba(139, 69, 19, 0.3);
    border-color: rgba(139, 69, 19, 0.6);
    animation: none;
}

.language-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.language-btn:hover .language-icon {
    transform: rotate(15deg) scale(1.1);
}

.language-text {
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

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

/* Music Control */
.music-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.music-btn {
    background: rgba(108, 117, 125, 0.2);
    border: 2px solid rgba(108, 117, 125, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.8);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.music-btn.muted {
    background: rgba(108, 117, 125, 0.2);
    border-color: rgba(108, 117, 125, 0.5);
    animation: none;
}

.music-btn:not(.muted) {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    animation: musicPulse 2s ease-in-out infinite;
}

.music-btn.muted:hover {
    background: rgba(108, 117, 125, 0.3);
    border-color: rgba(108, 117, 125, 0.8);
    box-shadow: 0 0 20px rgba(108, 117, 125, 0.4);
}

.music-icon {
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.music-btn.muted .music-icon {
    opacity: 0.5;
}

@keyframes musicPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
    }
}

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

.subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    font-family: 'Comic Neue', cursive;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 30px;
    align-items: start;
    opacity: 0;
    animation: fadeInContent 1.2s ease-in-out forwards;
    animation-delay: 1.5s;
}

@keyframes fadeInContent {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input Section */
.input-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
    text-align: center;
}

.upload-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.file-input {
    display: none;
}

.upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    animation: breathing 3s ease-in-out infinite;
    min-height: 48px;
    line-height: 1;
}

.upload-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.upload-btn:hover::before {
    left: 100%;
}

.upload-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
    border-color: rgba(255, 255, 255, 0.5);
}

.upload-btn:active {
    transform: translateY(0);
}

.upload-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.upload-text {
    font-size: 1rem;
    color: white;
    line-height: 1;
    font-weight: 600;
}

.upload-info {
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

.upload-info p {
    margin: 5px 0;
    font-weight: 400;
}

/* Canvas Section */
.canvas-section {
    display: flex;
    justify-content: center;
    align-items: center;
}

.canvas-container {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

#avatar-canvas {
    border-radius: 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    display: block;
    max-width: 100%;
    height: auto;
    cursor: default;
}

#avatar-canvas.draggable {
    cursor: grab;
}

#avatar-canvas.dragging {
    cursor: grabbing;
}

.canvas-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #adb5bd;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(3px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.placeholder-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-placeholder {
    width: 180px;
    height: 180px;
    opacity: 0.8;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    transition: all 0.3s ease;
}

.upload-placeholder:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.3));
}

/* Turkish version upload placeholder - same opacity as English */
.upload-placeholder[src*="upload_tr.png"] {
    opacity: 0.8;
}

.placeholder-text p {
    font-size: 1.1rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.6);
    text-shadow: none;
    letter-spacing: 0.5px;
    margin: 0;
    line-height: 1.4;
}

/* Controls Section */
.controls-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.controls-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: #333;
    text-align: center;
}

/* Hat Selection */
.hat-selection {
    margin-bottom: 30px;
}

.hat-selection label {
    display: block;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
    text-align: center;
}

.hat-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.hat-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border-radius: 15px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(102, 126, 234, 0.1);
    min-width: 120px;
}

.hat-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

.hat-option.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.hat-preview {
    width: 80px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    padding: 5px;
}

.hat-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    text-align: center;
}

.controls-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.slider-value {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
    color: #667eea;
    font-size: 0.9rem;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.toggle-input {
    display: none;
}

.toggle-label {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-label:hover {
    background: #dee2e6;
}

.toggle-input:checked + .toggle-label {
    background: linear-gradient(45deg, #667eea, #764ba2);
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-input:checked + .toggle-label .toggle-slider {
    transform: translateX(30px);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.download-btn {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(40, 167, 69, 0.3);
}

.reset-btn {
    background: linear-gradient(45deg, #6c757d, #495057);
    color: white;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(108, 117, 125, 0.3);
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
    opacity: 0;
    animation: fadeInFooter 1s ease-in-out forwards;
    animation-delay: 2s;
}

@keyframes fadeInFooter {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.creator-link {
    color: #8b5cf6;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    animation: blink 2s ease-in-out infinite;
}

.creator-link:hover {
    color: #a855f7;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
    transform: scale(1.05);
    animation: none;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
        text-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
    }
    25%, 75% {
        opacity: 0.7;
        text-shadow: 0 0 20px rgba(139, 92, 246, 1);
    }
    100% {
        opacity: 1;
        text-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .wizard-icon {
        width: 96px;
        height: 96px;
    }
    
    .input-section,
    .controls-section {
        padding: 20px;
    }
    
    .action-buttons {
        flex-direction: row;
    }
    
    .action-btn {
        flex: 1;
    }
}

/* Success/Error States */
.success {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1) !important;
}

.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
} 