/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

main {
    max-width: 600px;
    width: 100%;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 30px;
    text-align: center;
}

/* Header */
header {
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5rem;
    color: #4a4a4a;
    margin-bottom: 10px;
}

h2 {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 20px;
}

/* Form styling */
#flashcard-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

label {
    text-align: left;
    font-weight: bold;
    color: #555;
}

input[type="text"] {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: #b0b0b0;
}

button {
    padding: 12px 20px;
    background-color: #e0e0e0;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

button:hover {
    background-color: #d0d0d0;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

/* Flashcard display */
#flashcard-display {
    margin-top: 30px;
}

.flashcard {
    perspective: 1000px;
    width: 100%;
    height: 200px;
    margin: 0 auto 30px;
    cursor: pointer;
}

.flashcard > div {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.6s;
}

.front {
    background-color: #ffffff;
    border: 2px solid #e0e0e0;
    color: #333;
}

.back {
    background-color: #f0f8ff;
    border: 2px solid #b0c4de;
    color: #333;
    transform: rotateY(180deg);
}

.flipped .front {
    transform: rotateY(180deg);
}

.flipped .back {
    transform: rotateY(360deg);
}

.hidden {
    display: none;
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.controls button {
    flex: 1 1 auto;
    min-width: 120px;
    max-width: 150px;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    main {
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .flashcard {
        height: 150px;
    }

    .flashcard > div {
        font-size: 1rem;
    }

    .controls {
        flex-direction: column;
    }

    .controls button {
        width: 100%;
        max-width: none;
    }
}