body {
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bs-body-bg);
    user-select: none;
    -webkit-user-select: none;
}

main {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.card {
    transition: all 0.3s cubic-bezier(.25,.8,.25,1);
    cursor: pointer;
    overflow: hidden;
    position: relative;
    border: none;
    min-height: 250px;
}

.card-home {
    background-size: cover;
    background-position: center;
}

.card-home .card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding: 1.5rem 1rem 1rem;
    color: white;
    transition: background 0.3s;
}

.card:hover .card-overlay {
    background: linear-gradient(transparent, rgba(0,0,0,0.95));
}

.card-home .card-title {
    font-size: 1.5rem;
    margin-bottom: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

#full-card-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background: black;
}

.study-card-wrapper {
    width: 100vw;
    height: 100vh;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #000;
}

.answer-section {
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    width: 100%;
    will-change: opacity, transform;
}

.answer-section.d-none {
    display: none !important;
}

.answer-section.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.answer-box {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.card-content-overlay {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    position: relative;
}

.text-background {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    display: inline-block;
    margin: 0.2rem 0;
    color: white;
    will-change: transform;
}

.question-section {
    position: absolute;
    bottom: 2rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.study-text-white { color: white; }

.face-title { font-size: 3.5rem; font-weight: bold; }
.face-subtitle { font-size: 1.5rem; opacity: 0.9; }
.face-sentence { font-size: 1.2rem; max-width: 800px; }

.nav-btn {
    opacity: 0.1;
    transition: opacity 0.3s;
    background: transparent;
    max-width: 8%;
    height: 80vh;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    color: white;
    border: none;
    border-radius: 0;
    padding: 0;
}

.nav-btn:hover {
    opacity: 0.3;
    background: rgba(255,255,255,0.05);
}

#back-to-home {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    border-radius: 50%;
    z-index: 150;
    opacity: 0.85;
    background-color: white;
    color: black;
    border: none;
}

.audio-btn {
    background: none;
    border: none;
    color: inherit;
    padding: 0 5px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

.audio-btn:hover { opacity: 1; }
.audio-btn svg { fill: currentColor; display: block; }
.study-card-wrapper .audio-btn svg { width: 24px; height: 24px; }

.back-meaning { font-size: 3rem; color: #ffeb3b; }
body.card-open { overflow: hidden; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bs-body-bg); }
::-webkit-scrollbar-thumb { background: var(--bs-secondary-bg); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--bs-secondary); }

#footer {
    text-align: center;
    padding: 1rem;
    opacity: 0.5;
    font-size: 0.8rem;
    width: 100%;
}

.settings-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    padding: 0;
    line-height: 1;
    color: var(--bs-body-color);
    transition: transform 0.3s ease;
}

.settings-btn:hover {
    transform: rotate(45deg);
}

.dropdown-menu-end {
    right: 0;
    left: auto;
}

.view-section {
    transition: opacity 0.3s ease;
    height: 100%;
    width: 100%;
}

.card.hidden-card {
    opacity: 0.6;
    filter: grayscale(1);
}
.card.hidden-card::after {
    content: 'Hidden';
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.5);
    color: white;
    padding: 2px 5px;
    border-radius: 5px;
    font-size: 0.7rem;
}

.search-container {
    position: relative;
    display: inline-block;
}

#search-input {
    width: 0;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.3s ease;
    border-radius: 20px;
    padding: 0 10px;
}

#search-input.active {
    width: 200px;
    opacity: 1;
    padding: 5px 35px 5px 15px;
}

#search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    display: none;
    color: var(--bs-secondary);
}
