/* ============================================================
   FLASHCARD — Professional Design
   ============================================================ */

/* ---- Tab row ---- */
.fc-tabs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.fc-tabs {
    display: flex;
    gap: 0.25rem;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
}

.fc-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1rem;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

.fc-tab.active {
    background: white;
    color: #1e293b;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.fc-tab:hover:not(.active) {
    color: #334155;
}

/* ---- Biblioteca header ---- */
.biblioteca-header {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ---- Biblioteca card (public, read-only) ---- */
.biblioteca-flashcard-item {
    background-color: transparent;
    min-height: 200px;
    perspective: 1000px;
    cursor: pointer;
}

.biblioteca-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    z-index: 10;
}

/* ---- Card header (legacy) ---- */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.search-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 18px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar-wrapper:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

.search-bar-wrapper i {
    color: #94a3b8;
    font-size: 0.95rem;
}

.search-bar-wrapper input {
    border: none;
    outline: none;
    font-size: 0.93rem;
    color: #1e293b;
    width: 100%;
    background: transparent;
}

/* ---- Modal overlay ---- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal .card {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 18px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

.modal .card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.25rem;
}

/* ---- Breadcrumb de navegação ---- */
.fc-breadcrumb {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.fc-bc-btn {
    background: none;
    border: none;
    color: #2563eb;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.15s;
}
.fc-bc-btn:hover { background: #eff6ff; }

.fc-bc-link {
    background: none;
    border: none;
    color: #2563eb;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    transition: background 0.15s;
}
.fc-bc-link:hover { background: #eff6ff; }

.fc-bc-sep { color: #cbd5e1; font-size: 0.7rem; }

.fc-bc-current {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
    padding: 0.2rem 0.4rem;
}

.fc-study-all-btn {
    margin-left: auto;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.15s;
}
.fc-study-all-btn:hover { background: #1d4ed8; }

/* ---- Sub-tópico folder (nível 2) ---- */
.folder-subtopic { border-color: #e0e7ff; }
.folder-subtopic::before { background: #e0e7ff; border-color: #c7d2fe; }
.folder-subtopic:hover { border-color: #a5b4fc; }
.folder-subtopic:hover::before { background: #c7d2fe; border-color: #a5b4fc; }

.folder-icon-sub i { color: #6366f1 !important; }

/* ---- Folder header (back button row) ---- */
.folder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1.5rem;
    grid-column: 1 / -1;
}

.folder-header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
}

.folder-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* ---- Search dentro da pasta ---- */
.fc-card-search-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.45rem 0.85rem;
    width: 100%;
}

.fc-card-search-wrap i { color: #94a3b8; font-size: 0.82rem; }

.fc-card-search {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.875rem;
    color: #0f172a;
    width: 100%;
}

.fc-card-search::placeholder { color: #94a3b8; }

/* ---- Sort select ---- */
.fc-sort-wrap { display: flex; align-items: center; }

.fc-sort-select {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.42rem 0.75rem;
    font-size: 0.8rem;
    color: #475569;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}

.fc-sort-select:hover,
.fc-sort-select:focus { border-color: #2563eb; color: #2563eb; }

/* ---- Paginação de cards dentro da pasta ---- */
.fc-pag-btn {
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    font-size: 0.75rem;
    transition: all 0.15s;
}

.fc-pag-btn:hover:not(:disabled) { border-color: #2563eb; color: #2563eb; }
.fc-pag-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---- Folder cards ---- */
.folder-item {
    position: relative;
    background: white;
    border: 1.5px solid #dde3ef;
    border-radius: 0 14px 14px 14px;
    padding: 1.25rem 1.25rem 1.1rem;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

/* Aba da pasta */
.folder-item::before {
    content: '';
    position: absolute;
    top: -14px;
    left: -1.5px;
    width: 44%;
    height: 14px;
    background: #eef2f9;
    border: 1.5px solid #dde3ef;
    border-bottom: none;
    border-radius: 7px 7px 0 0;
    transition: background 0.18s, border-color 0.18s;
}

.folder-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(37,99,235,0.13);
    border-color: #bfdbfe;
}

.folder-item:hover::before {
    background: #dbeafe;
    border-color: #bfdbfe;
}

.folder-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.1rem;
}

.folder-icon i {
    color: #2563eb;
    font-size: 1.05rem;
}

.folder-name {
    font-size: 0.93rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.35;
}

.folder-count {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 999px;
    padding: 0.18rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 600;
    width: fit-content;
}

/* ---- Flashcard flip card ---- */
.flashcard-item {
    background-color: transparent;
    min-height: 200px;
    perspective: 1000px;
    cursor: pointer;
}

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

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

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.25rem 1.25rem 4rem;
    box-sizing: border-box;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-y: auto;
    border-radius: 16px;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    background: white;
    font-size: 0.97rem;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.6;
}

.flashcard-back {
    transform: rotateY(180deg);
    padding-bottom: 1.25rem;
}

.flashcard-front::-webkit-scrollbar,
.flashcard-back::-webkit-scrollbar {
    display: none;
}

/* ---- Card action buttons (edit / delete) ---- */
.card-actions {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    gap: 8px;
    z-index: 20;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: white;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.18s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.action-btn i {
    font-size: 0.9rem;
    margin: 0;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.edit-btn {
    color: #2563eb;
}
.edit-btn:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.delete-btn {
    color: #ef4444;
}
.delete-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

/* ---- Grid ---- */
#flashcards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    width: 100%;
}

/* ---- Subject selector (modal) ---- */
.subject-selector {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.subject-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.subject-input-wrapper:focus-within {
    border-color: #2563eb;
    background: white;
}

.subject-input-wrapper i:first-child {
    color: #2563eb;
    font-size: 0.95rem;
}

.subject-input-wrapper #dropdownChevron {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-left: auto;
    transition: transform 0.2s;
}

.subject-selector.open #dropdownChevron {
    transform: rotate(180deg);
}

.subject-input-wrapper input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.92rem;
    color: #1e293b;
    width: 100%;
}

.subject-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.10);
    z-index: 999;
    max-height: 220px;
    overflow-y: auto;
}

.subject-selector.open .subject-dropdown {
    display: block;
}

.subject-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.subject-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    border: 1.5px solid #bfdbfe;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

.subject-chip:hover,
.subject-chip.selected {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.no-results {
    text-align: center;
    color: #94a3b8;
    font-size: 0.88rem;
    padding: 10px;
}

/* ---- Form inputs inside modal ---- */
.filter-group {
    display: block;
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    font-size: 0.92rem;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.filter-group:focus {
    border-color: #2563eb;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.18s;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* ── Toolbar (filtro + info de paginação) ────────────────────────────────── */
.fc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
    flex-wrap: wrap;
}

.fc-pagination-info {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}

/* ── Filtro dropdown multi-select ────────────────────────────────────────── */
.fc-filter-wrapper {
    position: relative;
}

.fc-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    font-family: inherit;
    white-space: nowrap;
}

.fc-filter-btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.fc-filter-btn-active { border-color: #2563eb; color: #2563eb; background: #eff6ff; }

.fc-filter-btn .fa-chevron-down { font-size: 0.75rem; color: #94a3b8; transition: transform 0.2s; }
.fc-filter-btn .fa-chevron-down.rotated { transform: rotate(180deg); }

.fc-filter-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 260px;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.10);
    z-index: 200;
    overflow: hidden;
}

.fc-filter-dropdown.open { display: block; }

.fc-filter-search-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}

.fc-filter-search-wrap i { color: #94a3b8; font-size: 0.85rem; }

.fc-filter-search-wrap input {
    border: none;
    outline: none;
    font-size: 0.88rem;
    color: #1e293b;
    width: 100%;
    background: transparent;
    font-family: inherit;
}

.fc-filter-options {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.4rem 0;
}

.fc-opt-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    font-size: 0.88rem;
    color: #334155;
    transition: background 0.15s;
}

.fc-opt-row:hover { background: #f8fafc; }
.fc-opt-row.checked { color: #2563eb; font-weight: 600; }

.fc-opt-row input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #2563eb;
    cursor: pointer;
    flex-shrink: 0;
}

.fc-filter-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    border-top: 1px solid #f1f5f9;
}

.fc-clear-btn {
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: white;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.fc-clear-btn:hover { background: #f1f5f9; }

.fc-apply-btn {
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    border: none;
    background: #2563eb;
    color: white;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.fc-apply-btn:hover { background: #1d4ed8; }

/* ── Paginação ───────────────────────────────────────────────────────────── */
.fc-pagination-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.fc-page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: white;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    font-family: inherit;
}

.fc-page-btn:hover:not(:disabled) { background: #f1f5f9; border-color: #cbd5e1; }
.fc-page-btn.active { background: #2563eb; border-color: #2563eb; color: white; }
.fc-page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Folder item com botões ──────────────────────────────────────────────── */
.folder-item-study {
    gap: 0.5rem;
}

.folder-btns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.fc-study-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.8rem;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
    font-family: inherit;
}

.fc-study-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.35); }

.fc-manage-btn {
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    font-size: 0.88rem;
    transition: all 0.18s;
    font-family: inherit;
}

.fc-manage-btn:hover { background: #e2e8f0; color: #334155; }

/* ── Study mode layout ───────────────────────────────────────────────────── */
#study-mode {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 660px;
    margin: 0 auto;
    width: 100%;
    padding-bottom: 2rem;
}

.study-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.study-back-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    background: #f1f5f9;
    border: none;
    border-radius: 10px;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
    font-family: inherit;
}
.study-back-btn:hover { background: #e2e8f0; }

.study-header-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.study-subject-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}

.study-counter-badge {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
}

.study-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.study-timer {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
}

.study-timer i { color: #2563eb; font-size: 0.8rem; }

.study-manage-btn {
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.18s;
    flex-shrink: 0;
}
.study-manage-btn:hover { background: #e2e8f0; color: #334155; }

/* Progress bar */
.study-progress-track {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.study-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #0ea5e9);
    border-radius: 999px;
    transition: width 0.4s ease;
    width: 0%;
}

/* Card area */
.study-card-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.study-nav-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 50%;
    color: #64748b;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.18s;
}
.study-nav-btn:hover:not(:disabled) { background: #f1f5f9; border-color: #cbd5e1; color: #334155; }
.study-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* The flashcard itself */
.study-flashcard {
    flex: 1;
    min-height: 300px;
    perspective: 1200px;
    cursor: pointer;
}

.study-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 300px;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
}

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

.study-card-face {
    position: absolute;
    inset: 0;
    min-height: 300px;
    backface-visibility: hidden;
    border-radius: 18px;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.75rem;
    gap: 1rem;
    background: white;
    text-align: center;
    overflow-y: auto;
}

.study-face-back {
    transform: rotateY(180deg);
}

.study-face-tag {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #2563eb;
    background: #eff6ff;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.study-face-tag-back {
    color: #0369a1;
    background: #e0f2fe;
}

.study-face-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.65;
    max-width: 100%;
    word-break: break-word;
    white-space: pre-wrap;
}

.study-flip-hint {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #000000;
    margin-top: 0.5rem;
    animation: pulseHint 2s ease-in-out infinite;
}

@keyframes pulseHint {
    0%, 100% { opacity: 0.6; }
    50%       { opacity: 1; }
}

/* Performance buttons */
.study-perf-section {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.study-perf-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    margin: 0;
}

.study-perf-row {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    justify-content: center;
}

.perf-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.75rem 1.1rem;
    border: none;
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    max-width: 130px;
    font-family: inherit;
    color: white;
}

.perf-main { font-size: 0.88rem; font-weight: 700; }
.perf-interval { font-size: 0.72rem; opacity: 0.85; font-weight: 600; letter-spacing: 0.02em; }

.perf-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.25); }

.perf-errei  { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 4px 14px rgba(239,68,68,0.35); }
.perf-dificil{ background: linear-gradient(135deg, #f97316, #ea580c); box-shadow: 0 4px 14px rgba(249,115,22,0.35); }
.perf-bom    { background: linear-gradient(135deg, #8b5cf6, #7c3aed); box-shadow: 0 4px 14px rgba(139,92,246,0.35); }
.perf-facil  { background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 4px 14px rgba(34,197,94,0.35); }

/* ── Enterrar Card ── */
.study-bury-row {
    display: flex;
    justify-content: center;
    margin-top: 0.25rem;
    padding-bottom: 0.5rem;
}

.bury-btn {
    background: none;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    padding: 0.4rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.bury-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239,68,68,0.06);
}

/* ── SRS Config Modal ── */
.srs-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999;
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.srs-modal {
    background: #fff; border-radius: 16px; width: 100%; max-width: 480px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25); overflow: hidden; max-height: 90vh; display: flex; flex-direction: column;
}
.srs-modal-hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.1rem 1.4rem; border-bottom: 1px solid #f1f5f9;
}
.srs-modal-hdr h3 { margin: 0; font-size: 1rem; color: #1e293b; display: flex; align-items: center; gap: 0.5rem; }
.srs-close { background: none; border: none; cursor: pointer; color: #94a3b8; font-size: 1.1rem; padding: 0.25rem; }
.srs-modal-body { padding: 1.25rem 1.4rem; overflow-y: auto; flex: 1; }
.srs-modal-footer { padding: 1rem 1.4rem; border-top: 1px solid #f1f5f9; display: flex; justify-content: space-between; gap: 0.75rem; }

.srs-presets { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.25rem; }
.srs-preset input[type="radio"] { display: none; }
.srs-preset-card {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 0.75rem 1rem; border: 2px solid #e2e8f0; border-radius: 12px;
    cursor: pointer; transition: all 0.15s;
}
.srs-preset input:checked + .srs-preset-card { border-color: #0284c7; background: #f0f9ff; }
.srs-preset-card:hover { border-color: #7dd3fc; }
.srs-preset-icon { font-size: 1.4rem; flex-shrink: 0; }
.srs-preset-name { font-weight: 700; font-size: 0.9rem; color: #1e293b; }
.srs-preset-desc { font-size: 0.78rem; color: #64748b; margin-top: 1px; }

.srs-intervals-title { font-size: 0.85rem; font-weight: 700; color: #475569; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.4rem; }
.srs-interval-row {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 0; border-bottom: 1px solid #f8fafc;
}
.srs-interval-row:last-child { border-bottom: none; }
.srs-btn-preview {
    padding: 0.3rem 0.75rem; border-radius: 8px; font-size: 0.78rem; font-weight: 700;
    color: #fff; white-space: nowrap; min-width: 68px; text-align: center; flex-shrink: 0;
}
.perf-errei-prev  { background: linear-gradient(135deg, #ef4444, #dc2626); }
.perf-dificil-prev{ background: linear-gradient(135deg, #f97316, #ea580c); }
.perf-bom-prev    { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.perf-facil-prev  { background: linear-gradient(135deg, #22c55e, #16a34a); }
.srs-interval-desc { font-size: 0.82rem; color: #64748b; flex: 1; }
.srs-days-fixed { font-size: 0.82rem; color: #94a3b8; font-weight: 600; }
.srs-days-input-wrap { display: flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; color: #475569; }
.srs-days-input-wrap input {
    width: 56px; padding: 0.3rem 0.5rem; border: 1.5px solid #e2e8f0; border-radius: 8px;
    font-size: 0.875rem; text-align: center; font-family: inherit; outline: none;
}
.srs-days-input-wrap input:focus { border-color: #0284c7; }

.srs-btn-reset {
    background: none; border: 1.5px solid #e2e8f0; color: #64748b;
    padding: 0.65rem 1.1rem; border-radius: 10px; cursor: pointer; font-size: 0.875rem;
    font-weight: 600; display: flex; align-items: center; gap: 0.4rem; transition: all 0.15s;
}
.srs-btn-reset:hover { border-color: #94a3b8; color: #374151; }
.srs-btn-save {
    background: #0284c7; color: #fff; border: none; padding: 0.65rem 1.4rem;
    border-radius: 10px; cursor: pointer; font-size: 0.875rem; font-weight: 700;
    display: flex; align-items: center; gap: 0.4rem; transition: all 0.15s;
}
.srs-btn-save:hover { background: #0369a1; }

/* Summary screen */
.study-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
    padding: 2rem 1rem;
}

.study-summary-icon {
    font-size: 3.5rem;
    color: #22c55e;
}

.study-summary h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.study-summary p {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0;
}

.study-summary-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.ss-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.85rem 1.5rem;
    border-radius: 14px;
    color: white;
    min-width: 80px;
}

.ss-stat span { font-size: 1.75rem; font-weight: 800; }
.ss-stat small { font-size: 0.78rem; font-weight: 600; opacity: 0.9; }

.ss-facil  { background: linear-gradient(135deg, #22c55e, #16a34a); }
.ss-bom    { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.ss-dificil{ background: linear-gradient(135deg, #f97316, #ea580c); }
.ss-errei  { background: linear-gradient(135deg, #ef4444, #dc2626); }

.study-summary-btns {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.study-manage-btn-large{
    display:flex;
    align-items:center;
    gap:.5rem;

    padding:.65rem 1rem;

    background:#f1f5f9;
    border:1px solid #e2e8f0;
    border-radius:10px;

    color:#475569;
    font-size:.85rem;
    font-weight:600;

    cursor:pointer;
    transition:.2s;
}

.study-manage-btn-large:hover{
    background:#e2e8f0;
}

.study-manage-btn-large i{
    flex-shrink:0;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .study-perf-row { gap: 0.5rem; }
    .perf-btn { padding: 0.65rem 0.5rem; font-size: 0.75rem; max-width: none; }
    .perf-btn i { font-size: 1rem; }
    .study-nav-btn { width: auto; height: auto; font-size: 0.82rem; }
    .study-flashcard, .study-card-inner, .study-card-face { min-height: 240px; }
    .study-face-text { font-size: 0.97rem; }
    .study-back-btn span { display: none; }
}

@media (max-width: 768px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .card-header button {
        width: 100%;
        justify-content: center;
    }

    .folder-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .folder-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .folder-header button {
        width: 100%;
    }

    .modal .card {
        width: 95%;
        padding: 1.5rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    .card-actions {
        bottom: 0.75rem;
        right: 0.75rem;
    }

    .flashcard-front {
        padding-bottom: 4rem;
    }
}

/* ══════════════════════════════════════════════
   DARK MODE — flashcard.css (completo)
   ══════════════════════════════════════════════ */

/* ─── Tabs & Navegação ─── */
[data-theme="dark"] .fc-tabs {
    background: #19273a;
    border-color: #1e3550;
}
[data-theme="dark"] .fc-tab { color: #94a3b8; }
[data-theme="dark"] .fc-tab:hover { color: #e2e8f0; }
[data-theme="dark"] .fc-tab.active {
    background: #111d2e;
    color: #60a5fa;
    box-shadow: none;
}

/* ─── Barra de busca ─── */
[data-theme="dark"] .search-bar-wrapper {
    background: #19273a;
    border-color: #1e3550;
}
[data-theme="dark"] .search-bar-wrapper input {
    background: transparent;
    color: #e2e8f0;
}
[data-theme="dark"] .search-bar-wrapper input::placeholder { color: #64748b; }
[data-theme="dark"] .search-bar-wrapper i { color: #64748b; }

/* ─── Filtros ─── */
[data-theme="dark"] .fc-filter-btn {
    background: #19273a;
    border-color: #1e3550;
    color: #94a3b8;
}
[data-theme="dark"] .fc-filter-btn:hover {
    background: #1e3550;
    color: #e2e8f0;
}
[data-theme="dark"] .fc-filter-btn.active {
    background: #1d3a6b;
    border-color: #3b82f6;
    color: #93c5fd;
}
[data-theme="dark"] .fc-filter-dropdown {
    background: #19273a;
    border-color: #1e3550;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
[data-theme="dark"] .fc-filter-dropdown label { color: #94a3b8; }
[data-theme="dark"] .fc-filter-dropdown label:hover { color: #e2e8f0; }

/* ─── Pastas / Folders ─── */
[data-theme="dark"] .folder-item {
    background: #19273a;
    border-color: #1e3550;
}
[data-theme="dark"] .folder-item:hover {
    background: #1e3550;
    border-color: #2d4a6b;
}
[data-theme="dark"] .folder-item-name { color: #e2e8f0; }
[data-theme="dark"] .folder-item-count { color: #64748b; }

/* ─── Cards (flip) ─── */
[data-theme="dark"] .flashcard-front,
[data-theme="dark"] .flashcard-back {
    background: #19273a;
    border-color: #1e3550;
    color: #e2e8f0;
}
[data-theme="dark"] .flashcard-front:hover,
[data-theme="dark"] .flashcard-back:hover { border-color: #3b82f6; }

/* ─── Botões de ação (editar/deletar card) ─── */
[data-theme="dark"] .action-btn {
    background: #19273a;
    border-color: #1e3550;
    color: #94a3b8;
}
[data-theme="dark"] .action-btn:hover {
    background: #1e3550;
    color: #e2e8f0;
}

/* ─── Paginação ─── */
[data-theme="dark"] .fc-pag-btn,
[data-theme="dark"] .fc-page-btn {
    background: #19273a;
    border-color: #1e3550;
    color: #94a3b8;
}
[data-theme="dark"] .fc-pag-btn:hover,
[data-theme="dark"] .fc-page-btn:hover {
    background: #1e3550;
    color: #e2e8f0;
}
[data-theme="dark"] .fc-page-btn.active {
    background: #1d3a6b;
    border-color: #3b82f6;
    color: #93c5fd;
}

/* ─── Modo de estudo — card face ─── */
[data-theme="dark"] .study-card-face {
    background: #19273a;
    border-color: #1e3550;
    color: #e2e8f0;
}
[data-theme="dark"] .study-face-tag {
    background: #0c2a3d;
    color: #7dd3fc;
}
[data-theme="dark"] .study-face-tag-back {
    background: #0a2026;
    color: #67e8f9;
}
[data-theme="dark"] .study-flip-hint {
    color: #94a3b8 !important;
}
[data-theme="dark"] .study-back-btn {
    background: #19273a;
    border-color: #1e3550;
    color: #94a3b8;
}
[data-theme="dark"] .study-back-btn:hover {
    background: #1e3550;
    color: #e2e8f0;
}
[data-theme="dark"] .study-timer {
    background: #19273a;
    color: #94a3b8;
    border-color: #1e3550;
}
[data-theme="dark"] .study-manage-btn,
[data-theme="dark"] .study-manage-btn-large {
    background: #19273a;
    border-color: #1e3550;
    color: #94a3b8;
}
[data-theme="dark"] .study-manage-btn:hover,
[data-theme="dark"] .study-manage-btn-large:hover {
    background: #1e3550;
    color: #e2e8f0;
}
[data-theme="dark"] .study-nav-btn {
    background: #19273a;
    border-color: #1e3550;
    color: #94a3b8;
}
[data-theme="dark"] .study-nav-btn:hover {
    background: #1e3550;
    color: #e2e8f0;
}
[data-theme="dark"] .study-subject-label { color: #94a3b8; }

/* ─── Tela de resumo do estudo ─── */
[data-theme="dark"] .study-summary { color: #e2e8f0; }
[data-theme="dark"] .study-summary h2 { color: #e2e8f0; }

/* ─── Modal SRS ─── */
[data-theme="dark"] .srs-modal,
[data-theme="dark"] .srs-modal .modal-box {
    background: #111d2e;
    border-color: #1e3550;
    color: #e2e8f0;
}
[data-theme="dark"] .srs-preset-card {
    background: #19273a;
    border-color: #1e3550;
}
[data-theme="dark"] .srs-preset-card:hover {
    background: #1e3550;
    border-color: #3b82f6;
}
[data-theme="dark"] .srs-preset-name { color: #e2e8f0; }
[data-theme="dark"] .srs-preset-desc { color: #94a3b8; }
[data-theme="dark"] .srs-btn-reset {
    background: transparent;
    border-color: #1e3550;
    color: #94a3b8;
}
[data-theme="dark"] .srs-btn-reset:hover {
    background: #1e3550;
    color: #e2e8f0;
}
[data-theme="dark"] .srs-days-input-wrap input {
    background: #19273a;
    border-color: #1e3550;
    color: #e2e8f0;
}

/* ─── Breadcrumb ─── */
[data-theme="dark"] .fc-bc-current { color: #e2e8f0; }
[data-theme="dark"] .fc-bc-sep { color: #64748b; }

/* ─── Input de assunto / dropdown ─── */
[data-theme="dark"] .subject-input-wrapper {
    background: #19273a;
    border-color: #1e3550;
}
[data-theme="dark"] .subject-input-wrapper input {
    background: transparent;
    color: #e2e8f0;
}
[data-theme="dark"] .subject-dropdown {
    background: #19273a;
    border-color: #1e3550;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
[data-theme="dark"] .subject-dropdown-item { color: #94a3b8; }
[data-theme="dark"] .subject-dropdown-item:hover {
    background: #1e3550;
    color: #e2e8f0;
}

/* ─── Botão secundário ─── */
[data-theme="dark"] .btn-secondary {
    background: #19273a;
    border-color: #1e3550;
    color: #94a3b8;
}
[data-theme="dark"] .btn-secondary:hover {
    background: #1e3550;
    color: #e2e8f0;
}

/* ─── Cabeçalho biblioteca ─── */
[data-theme="dark"] .biblioteca-header {
    background: #0c2a3d;
    border-color: #1e3550;
    color: #7dd3fc;
}

/* ─── Ordenação e limpar filtros ─── */
[data-theme="dark"] .fc-sort-select {
    background: #19273a;
    border-color: #1e3550;
    color: #94a3b8;
}
[data-theme="dark"] .fc-clear-btn {
    background: #19273a;
    border-color: #1e3550;
    color: #94a3b8;
}
[data-theme="dark"] .fc-clear-btn:hover {
    background: #1e3550;
    color: #e2e8f0;
}

/* ─── Modal geral (criar/editar card) ─── */
[data-theme="dark"] .modal .card,
[data-theme="dark"] .modal-box {
    background: #111d2e;
    border-color: #1e3550;
    color: #e2e8f0;
}
[data-theme="dark"] .modal input,
[data-theme="dark"] .modal textarea,
[data-theme="dark"] .modal select {
    background: #19273a;
    border-color: #1e3550;
    color: #e2e8f0;
}
[data-theme="dark"] .modal input::placeholder,
[data-theme="dark"] .modal textarea::placeholder { color: #64748b; }
