@font-face {
    font-family: 'Vazirmatn';
    src: url('Vazirmatn-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #4a6da7;
    --secondary-color: #f39c12;
    --ternary-color: #2d5070;
    --accent-color: #e74c3c;
    --light-color: #f4f4f4;
    --dark-color: #333;
    --gold-color: #d4af37;
    --blue-gradient: linear-gradient(135deg, #3a6186 0%, #89253e 100%);
    --transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden; /* Prevent scrolling */
    margin: 0;
    padding: 0;
}

body {
    font-family:  'Vazirmatn', 'Tahoma', sans-serif;
    background: var(--blue-gradient);
    color: var(--dark-color);
    direction: rtl;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.app-container {
    width: 100%;
    height: 100vh; /* Use viewport height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between; /* Changed to space-between */
    overflow: hidden;
    position: relative; /* Added for absolute positioning of children */
}

.container {
    width: 100%;
    max-width: 1000px;
    flex: 1; /* Fill available space */
    margin-bottom: 10px; /* Space for message */
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    border-radius: 15px;
    overflow: hidden;
    background-color: white;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s var(--transition-timing);
}

.header {
    background: var(--primary-color);
    color: white;
    padding: 15px;
    text-align: center;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.header h1 {
    font-family: 'Vazirmatn', cursive;
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 600;
    animation: textGlow 3s infinite alternate;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.header p {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

.header::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(30deg);
    z-index: -1;
    animation: shimmer 15s infinite linear;
}

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

@keyframes textGlow {
    0% {
        text-shadow: 0 0 5px rgba(255,255,255,0.5);
    }
    100% {
        text-shadow: 0 0 15px rgba(255,255,255,0.8), 0 0 30px rgba(255,255,255,0.4);
    }
}

.progress-container {
    width: 100%;
    height: 6px;
    background: #ddd;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    width: 0;
    transition: width 0.3s linear;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.5), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100px);
    }
    100% {
        transform: translateX(1000px);
    }
}

.slideshow {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: var(--ternary-color);
    flex: 1; /* Fill available space */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.slide-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Simplified transitions for better performance */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    background: var(--ternary-color);
    transition: opacity 0.8s ease, transform 0.8s var(--transition-timing);
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

/* Simplified transition effects */
.slide.transition-fade {
    transform: scale(1.05);
}

.slide.transition-zoom {
    transform: scale(0.8);
}

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

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

.slide.active.transition-fade,
.slide.active.transition-zoom {
    transform: scale(1);
}

.slide.active.transition-slide-left,
.slide.active.transition-slide-right {
    transform: translateX(0);
}

.slide img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%; /* Image will fill slideshow height */
    object-fit: contain; /* Maintain aspect ratio */
    transition: transform 1s ease;
}

.caption {
    position: absolute;
    bottom: 0;
    font-family:  'Vazirmatn', 'Tahoma', sans-serif;
    left: 0;
    width: 100%;
    padding: 15px;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 1rem;
    text-align: center;
    opacity: 0;
    transform: translateY(50%);
    transition: transform 0.5s ease, opacity 0.5s ease;
    backdrop-filter: blur(5px);
}

.slide.active .caption {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

.dots-container {
    display: flex;
    justify-content: center;
    margin: 10px 0;
    flex-shrink: 0;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ccc;
    margin: 0 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot:hover {
    background: #999;
    transform: scale(1.2);
}

.dot.active {
    background: var(--primary-color);
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(74, 109, 167, 0.5);
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    background: var(--light-color);
    border-top: 1px solid #ddd;
    flex-shrink: 0;
}

.control-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin: 0 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.control-btn:hover {
    background: #3a5a94;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.play-pause {
    width: 55px;
    height: 55px;
    background: var(--secondary-color);
    z-index: 2;
}

.play-pause:hover {
    background: #e67e22;
}

.message {
    width: 100%;
    text-align: center;
    margin: 0 auto 10px;
    padding: 0 20px;
    max-width: 1000px;
}

.message h2 {
    font-family: 'Vazirmatn', cursive;
    color: var(--gold-color);
    margin-bottom: 10px;
    font-size: 1.8rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    position: relative;
    display: inline-block;
}

.message h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 10%;
    width: 80%;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--gold-color), transparent);
}

.message p {
    font-size: 1rem;
    line-height: 1.5;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    margin: 0 auto 5px;
}

.celebration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
}

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--blue-gradient);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader-content {
    position: relative;
    width: 200px;
    height: 200px;
}

.loader-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border: 8px solid rgba(255,255,255,0.1);
    border-top: 8px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.loader-inner-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 6px solid rgba(255,255,255,0.1);
    border-bottom: 6px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 2s cubic-bezier(0.4, 0, 0.2, 1) infinite reverse;
}

.loader-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.3rem;
    color: white;
    width: 100%;
    text-align: center;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.loader-progress {
    position: absolute;
    bottom: 10px;
    left: 10%;
    width: 80%;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

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

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 1s cubic-bezier(0, 0, 0.2, 1);
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
    }
    
    .play-pause {
        width: 50px;
        height: 50px;
    }
    
    .message h2 {
        font-size: 1.5rem;
    }
    
    .message p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header p {
        font-size: 0.8rem;
    }
    
    .message h2 {
        font-size: 1.2rem;
    }
    
    .message p {
        font-size: 0.8rem;
    }
    
    .control-btn {
        width: 35px;
        height: 35px;
        margin: 0 8px;
    }
    
    .play-pause {
        width: 45px;
        height: 45px;
    }
}