* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f0f2f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100vw;
    overflow-x: hidden;
}

.container {
    width: 100vw;
    max-width: 100vw;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1vh;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.category-selector {
    width: 100%;
    padding: 1vh;
}

select {
    width: 100%;
    padding: 1vh;
    font-size: 4vw;
    border: 2px solid #ddd;
    border-radius: 8px;
    background-color: white;
    -webkit-appearance: none;
    appearance: none;
}

.flashcard-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    touch-action: pan-y pinch-zoom;
    width: 100%;
    padding: 0;
}

.flashcard {
    width: 100%;
    height: 60vh;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 16px;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2vh;
    background-color: white;
    border-radius: 16px;
}

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

.card-front p, .card-back p {
    font-size: 8vw;
    line-height: 1.3;
    color: #1a1a1a;
    width: 100%;
    padding: 0 2vw;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 1vh;
    padding: 1vh 0;
    width: 100%;
}

button {
    padding: 2vh 4vw;
    font-size: 4vw;
    border: none;
    border-radius: 8px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

button:active {
    background-color: #0056b3;
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2vw;
    width: 100%;
    padding: 0 2vw;
}

.navigation button {
    flex: 1;
    max-width: 15vw;
}

#cardCounter {
    font-size: 4vw;
    color: #666;
}

/* Swipe animation */
.swipe-left {
    animation: swipeLeft 0.3s ease-out;
}

.swipe-right {
    animation: swipeRight 0.3s ease-out;
}

@keyframes swipeLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

@keyframes swipeRight {
    0% { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

/* Flip animation */
.flipped .card-inner {
    transform: rotateY(180deg);
}

/* Portrait mode styles */
@media screen and (orientation: portrait) {
    .flashcard {
        height: 65vh;
    }

    .card-front p, .card-back p {
        font-size: 10vw;
    }

    .controls {
        padding: 1vh 2vw;
    }
}

/* Landscape mode styles */
@media screen and (orientation: landscape) {
    .container {
        gap: 0.5vh;
    }

    .flashcard {
        height: 70vh;
    }

    .card-front p, .card-back p {
        font-size: 6vw;
    }

    .controls {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 2vw;
        padding: 0.5vh 0;
    }

    .navigation {
        margin: 0;
        width: auto;
    }
} 