/* Mobile-first responsive design for flashcards */
.flashcard-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    perspective: 1000px;
    padding: 0 15px;
}

.flashcard {
    width: 100%;
    height: auto;
    min-height: 320px;
    position: relative;
    cursor: pointer;
    margin-bottom: 20px;
}

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

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

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 320px;
    box-sizing: border-box;
}

.flashcard-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.flashcard-back {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    transform: rotateY(180deg);
}

/* Loading and error states */
.flashcard-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 40px;
}

.flashcard-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
}

/* Controls styling */
.flashcard-controls {
    padding: 20px 10px;
}

.flashcard-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Alert customizations */
.alert-info-custom {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #2196f3;
    color: #0d47a1;
    border-radius: 15px;
}

.alert-success-custom {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    border: 2px solid #4caf50;
    color: #1b5e20;
    border-radius: 15px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .flashcard {
        min-height: 280px;
        margin-bottom: 15px;
    }

    .flashcard-front, .flashcard-back {
        padding: 15px;
        min-height: 280px;
    }

    .flashcard h3 {
        font-size: 1.2rem;
        line-height: 1.3;
        margin-bottom: 15px;
    }

    .flashcard h4 {
        font-size: 1rem;
        margin-bottom: 8px;
        margin-top: 15px;
    }

    .flashcard p {
        font-size: 0.9rem;
        line-height: 1.4;
        margin-bottom: 10px;
    }
}

@media (max-width: 576px) {
    .flashcard {
        min-height: 250px;
    }

    .flashcard-front, .flashcard-back {
        padding: 12px;
        min-height: 250px;
    }

    .flashcard h3 {
        font-size: 1.1rem;
    }

    .flashcard h4 {
        font-size: 0.95rem;
    }

    .flashcard p {
        font-size: 0.85rem;
    }
}

/* Utility classes */
.text-responsive {
    word-wrap: break-word;
    overflow-wrap: break-word;
}
