/* 
  Custom styles to supplement Tailwind CSS.
  Most layout, spacing, and colors are now handled by Tailwind utilities. 
*/

:root {
    --text-color: #1f2937;
    /* Tailwind gray-800 */
    --correct-color: #10b981;
    /* Tailwind emerald-500 */
    --incorrect-color: #ef4444;
    /* Tailwind red-500 */
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

/* Base override for term display */
.term {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
}

/* Custom Interactive Options for Multiple Choice */
.option-btn {
    width: 100%;
    text-align: left;
    margin-bottom: 0.75rem;
}

.option-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f9fafb;
    transform: none;
    box-shadow: none;
}

/* Fill Blank custom structure */
.fill-blank-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fill-blank-form input {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1.125rem;
    border: 2px solid #e5e7eb;
    /* Tailwind gray-200 */
    border-radius: 1rem;
    outline: none;
    transition: all 0.2s ease;
    background-color: #f9fafb;
}

.fill-blank-form input:focus {
    border-color: #3b82f6;
    /* Tailwind blue-500 */
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.fill-blank-form button {
    width: 100%;
    padding: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 1rem;
    /* background-color: #1f2937; */
    /* Tailwind gray-800 */
    color: white;
    transition: background-color 0.2s ease;
}

.fill-blank-form button:hover:not(:disabled) {
    background-color: #111827;
    /* Tailwind gray-900 */
}

/* Feedback blocks */
.feedback {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: 1rem;
    text-align: center;
    font-weight: 500;
    font-size: 1.125rem;
    animation: fadeInUp 0.4s ease;
}

.feedback.correct {
    background-color: #ecfdf5;
    /* Tailwind emerald-50 */
    color: #047857;
    /* Tailwind emerald-700 */
    border: 1px solid #a7f3d0;
    /* Tailwind emerald-200 */
}

.feedback.incorrect {
    background-color: #fef2f2;
    /* Tailwind red-50 */
    color: #b91c1c;
    /* Tailwind red-700 */
    border: 1px solid #fecaca;
    /* Tailwind red-200 */
}

.correct-ans {
    margin-top: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Custom Webkit scrollbar for word list */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    /* Tailwind gray-300 */
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
    /* Tailwind gray-400 */
}

/* Global Button Styles (Retro Brutalism) */
.btn-primary,
.btn-secondary,
.btn-danger {
    color: rgb(17 24 39 / var(--tw-text-opacity, 1)) !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 24px;
    border-radius: 10px;
    border: 1px solid #fafafa;
    /* background: #252525; */
    cursor: pointer;
    transition: all 0.1s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
}

/* Base Shadow */
.btn-primary:not(:disabled) {
    box-shadow: 4px 4px 0px 0px #cbd3e4;
    /* Blue shadow */
    border-color: #cbd3e4;
}

.btn-secondary:not(:disabled) {
    box-shadow: 4px 4px 0px 0px #cbd3e4;
    /* Gray shadow */
    border-color: #cbd3e4;
}

.btn-danger:not(:disabled) {
    box-shadow: 4px 4px 0px 0px #f1d9d9;
    /* Red shadow */
    border-color: #f1d9d9;
}

/* Active State */
.btn-primary:active:not(:disabled),
.btn-secondary:active:not(:disabled),
.btn-danger:active:not(:disabled) {
    box-shadow: none !important;
    transform: translate(4px, 4px);
}

/* Focus State */
.btn-primary:focus,
.btn-secondary:focus,
.btn-danger:focus {
    outline: none;
    border-width: 3px;
}

/* Disabled State */
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #555;
    border-color: #777;
    box-shadow: 2px 2px 0px 0px #777;
}

/* Flashcard Specific Styles */
.flashcard-container {
    perspective: 1000px;
    width: 100%;
    max-width: 500px;
    height: 320px;
    cursor: pointer;
    margin: 0 auto;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

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

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 2rem;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.1);
    border: 2px solid #f3f4f6;
    padding: 2rem;
    background: white;
}

.flashcard-back {
    transform: rotateY(180deg);
    background: #f8fafc;
}

.flashcard-front .term-display {
    font-size: 3rem;
    font-weight: 800;
    color: #1f2937;
}

.flashcard-back .meaning-display {
    font-size: 1.75rem;
    font-weight: 700;
    color: #374151;
}

.flashcard-back .example-display {
    font-size: 1rem;
    font-style: italic;
    color: #6b7280;
    margin-top: 1.5rem;
    line-height: 1.5;
}

.flip-hint {
    position: absolute;
    bottom: 1.5rem;
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}