:root {
    --primary-color: #1e3c72;
    --secondary-color: #2a5298;
    --accent-color: #f4a261;
    --light-color: #f9f9f9;
    --text-color: #444;
    --border-radius: 12px;
    --box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 800px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
    position: relative;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1rem;
    color: var(--secondary-color);
    opacity: 0.9;
}

.selection {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
}

select, button {
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    background: white;
    color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    text-align: center;
    font-family: 'Poppins', sans-serif;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 1em;
}

button {
    background: linear-gradient(135deg, var(--accent-color), #e63946);
    color: white;
    border: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

select:hover {
    border-color: var(--accent-color);
}

#cardCountSection {
    display: none;
    width: 100%;
    justify-content: center;
}

#contentType{
  width: 230px;
}

.carousel {
    position: relative;
    height: 400px;
    margin-bottom: 20px;
    overflow: hidden;
    user-select: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.welcome-message {
    text-align: center;
    padding: 20px;
    max-width: 500px;
}

.welcome-message h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-family: 'Playfair Display', serif;
}

.welcome-message p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.hint {
    background: #f0f7ff;
    padding: 12px;
    border-radius: var(--border-radius);
    color: var(--secondary-color);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.card {
    position: absolute;
    width: 100%;
    max-width: 500px;
    height: 100%;
    perspective: 1000px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.card.active {
    opacity: 1;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front{
  background-color: rgb(247, 207, 216);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--border-radius);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: white;
}

.card-back {
    transform: rotateY(180deg);
    background: #fef9e7;
}

.word-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.word {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    word-break: break-word;
}

.speaker-btn {
    background: none;
    border: none;
    margin-top: 20px;
    margin-bottom: 20px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--secondary-color);
    transition: all 0.3s ease;
    padding: 10px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}



.meaning {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    text-align: center;
    font-style: italic;
}

.examples {
    width: 100%;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 10px;
}

.examples p {
    margin-bottom: 10px;
    padding-left: 15px;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.5;
}

.examples p::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.controls {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.nav-btn {
    flex: 1;
    background: var(--secondary-color);
}

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

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    select, button {
        min-width: 100%;
    }
    
    .selection {
        flex-direction: column;
    }
    
    .carousel {
        height: 350px;
        margin-bottom: 30px;
    }
    
    .word {
        font-size: 1.6rem;
    }
    
    .meaning {
        font-size: 1.1rem;
    }
    
    .examples p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .carousel {
        height: 300px;
    }
    
    .card-front, .card-back {
        padding: 20px;
    }
    
    .word {
        font-size: 1.4rem;
    }
    
    .meaning {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .examples {
        max-height: 120px;
    }
    
    .examples p {
        font-size: 0.85rem;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .nav-btn {
        width: 100%;
    }
}