* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.upload-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #f8f9ff, #ffffff);
    margin-bottom: 30px;
}

.upload-area:hover {
    border-color: #764ba2;
    background: linear-gradient(45deg, #f0f2ff, #f8f9ff);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #764ba2;
    background: linear-gradient(45deg, #e8ebff, #f0f2ff);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.upload-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.upload-content p {
    color: #666;
    margin-bottom: 20px;
}

.upload-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.context-section {
    margin-bottom: 30px;
}

.context-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.context-section textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s ease;
}

.context-section textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.options-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.option-group {
    display: flex;
    flex-direction: column;
}

.option-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.option-group select {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s ease;
}

.option-group select:focus {
    outline: none;
    border-color: #667eea;
}

.option-group input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.create-btn {
    width: 100%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 20px;
    border-radius: 15px;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.create-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.create-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.preview-section {
    margin: 30px 0;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.image-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.thumbnail {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.thumbnail:hover {
    transform: scale(1.05);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slideshow-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.slideshow-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.slide-area {
    position: relative;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 40px 20px 20px;
    font-size: 1.1rem;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.slide:hover .caption {
    transform: translateY(0);
}

.slideshow-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.control-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.progress-bar {
    background: #e1e5e9;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    background: linear-gradient(45deg, #667eea, #764ba2);
    height: 100%;
    width: 0%;
    transition: width 0.1s linear;
}

.slide-counter {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

.back-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e1e5e9;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.slide.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slide.fade-in {
    opacity: 1;
    transition: opacity 0.5s ease;
}

.slide.slide-left {
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.slide.slide-right {
    transform: translateX(100%);
    transition: transform 0.5s ease;
}

.slide.zoom-out {
    transform: scale(0);
    transition: transform 0.5s ease;
}

.slide.zoom-in {
    transform: scale(1);
    transition: transform 0.5s ease;
}

.slide.flip-out {
    transform: rotateY(90deg);
    transition: transform 0.5s ease;
}

.slide.flip-in {
    transform: rotateY(0deg);
    transition: transform 0.5s ease;
}

.slide.star-out {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
    transition: all 0.6s ease;
}

.slide.star-in {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    transition: all 0.6s ease;
    animation: starBurst 0.6s ease-out;
}

@keyframes starBurst {
    0% { 
        transform: scale(0) rotate(-180deg);
        opacity: 0;
        filter: brightness(2);
    }
    50% { 
        transform: scale(1.1) rotate(-90deg);
        opacity: 0.8;
        filter: brightness(1.5);
    }
    100% { 
        transform: scale(1) rotate(0deg);
        opacity: 1;
        filter: brightness(1);
    }
}

.slide.circle-out {
    transform: scale(0);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.7s ease;
}

.slide.circle-in {
    transform: scale(1);
    border-radius: 0%;
    opacity: 1;
    transition: all 0.7s ease;
    animation: circleExpand 0.7s ease-out;
}

@keyframes circleExpand {
    0% { 
        transform: scale(0);
        border-radius: 50%;
        opacity: 0;
    }
    50% { 
        transform: scale(0.8);
        border-radius: 25%;
        opacity: 0.7;
    }
    100% { 
        transform: scale(1);
        border-radius: 0%;
        opacity: 1;
    }
}

.slide.clock-wipe-out {
    opacity: 0;
    transform: scale(0.8);
}

.slide.clock-wipe-in {
    opacity: 1;
    transform: scale(1);
    animation: clockWipeReveal 0.8s ease-out;
    position: relative;
    overflow: hidden;
}

.slide.clock-wipe-in::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: #000;
    transform-origin: center;
    animation: clockWipeMask 0.8s ease-out forwards;
    z-index: 10;
}

@keyframes clockWipeReveal {
    0% { 
        transform: scale(0.8) rotate(-5deg);
        opacity: 0.8;
    }
    100% { 
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes clockWipeMask {
    0% { 
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% { 
        transform: translate(-50%, -50%) rotate(360deg) scale(0);
        opacity: 0;
    }
}

.slide.fade-in.star-in {
    opacity: 1;
    transform: scale(1) rotate(360deg);
    transition: all 0.8s ease;
    animation: starSpinFade 0.8s ease-out;
}

@keyframes starSpinFade {
    0% { 
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.2) rotate(180deg);
    }
    100% { 
        opacity: 1;
        transform: scale(1) rotate(360deg);
    }
}

.slide.zoom-in.circle-in {
    transform: scale(1);
    opacity: 1;
    animation: zoomCircle 0.7s ease-out;
}

@keyframes zoomCircle {
    0% { 
        transform: scale(0);
        border-radius: 50%;
        opacity: 0;
    }
    60% { 
        transform: scale(1.1);
        border-radius: 20%;
        opacity: 0.8;
    }
    100% { 
        transform: scale(1);
        border-radius: 0%;
        opacity: 1;
    }
}

.slide.flip-in.star-in {
    transform: rotateY(0deg) scale(1);
    opacity: 1;
    animation: flipStar 0.9s ease-out;
}

@keyframes flipStar {
    0% { 
        transform: rotateY(90deg) scale(0);
        opacity: 0;
    }
    50% { 
        transform: rotateY(45deg) scale(1.2);
        opacity: 0.8;
    }
    100% { 
        transform: rotateY(0deg) scale(1);
        opacity: 1;
    }
}

.transition-preview {
    margin-top: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    padding: 15px;
    background: #f8f9ff;
}

.preview-container {
    position: relative;
    width: 100%;
    height: 80px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.preview-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s ease;
    opacity: 0;
    transform: scale(0.8);
}

.preview-slide.active {
    opacity: 1;
    transform: scale(1);
}

.preview-slide:nth-child(1) {
    background: linear-gradient(45deg, #4CAF50, #45a049);
}

.preview-slide:nth-child(2) {
    background: linear-gradient(45deg, #FF6B6B, #ee5253);
}

.preview-content {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.preview-btn {
    width: 100%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.preview-slide.preview-fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.preview-slide.preview-fade-in {
    opacity: 1;
    transition: opacity 0.5s ease;
}

.preview-slide.preview-slide-left {
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.preview-slide.preview-slide-right {
    transform: translateX(100%);
    transition: transform 0.5s ease;
}

.preview-slide.preview-zoom-out {
    transform: scale(0);
    opacity: 0;
    transition: all 0.5s ease;
}

.preview-slide.preview-zoom-in {
    transform: scale(1);
    opacity: 1;
    transition: all 0.5s ease;
}

.preview-slide.preview-flip-out {
    transform: rotateY(90deg);
    transition: transform 0.5s ease;
}

.preview-slide.preview-flip-in {
    transform: rotateY(0deg);
    transition: transform 0.5s ease;
}

.preview-slide.preview-star-out {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
    transition: all 0.6s ease;
}

.preview-slide.preview-star-in {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    transition: all 0.6s ease;
}

.preview-slide.preview-circle-out {
    transform: scale(0);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.7s ease;
}

.preview-slide.preview-circle-in {
    transform: scale(1);
    border-radius: 8px;
    opacity: 1;
    transition: all 0.7s ease;
}

.preview-slide.preview-clock-wipe-out {
    opacity: 0;
    transform: scale(0.8);
}

.preview-slide.preview-clock-wipe-in {
    opacity: 1;
    transform: scale(1);
    position: relative;
    overflow: hidden;
}

.preview-slide.preview-clock-wipe-in::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: #000;
    transform-origin: center;
    animation: previewClockWipe 0.8s ease-out forwards;
    z-index: 10;
}

@keyframes previewClockWipe {
    0% { 
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% { 
        transform: translate(-50%, -50%) rotate(360deg) scale(0);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .upload-section {
        padding: 20px;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    .options-section {
        grid-template-columns: 1fr;
    }
    
    .slideshow-controls {
        gap: 15px;
    }
    
    .control-btn {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}