
body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--header-height));
}

.set-wrapper {
    max-width: 1200px; 
    margin: 0 auto;
    width: 100%;
    padding: 20px;
    opacity: 0;
    animation: setAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes setAppear {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.set-hero {
    position: relative;
    z-index: 100;
    border-radius: 24px;
    padding: 32px 40px;
    margin-bottom: 40px;
    background: rgba(var(--bg-light-rgb), 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.hero-bg-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.hero-bg-glow {
    position: absolute;
    top: -50%;
    left: -20%;
    width: 60%;
    height: 150%;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.15) 0%, transparent 60%);
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
}

.hero-top-bar, .set-main-info, .learn-hero-action {
    position: relative;
    z-index: 1;
}


.hero-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    padding: 10px 20px;
    border-radius: 12px;
    background: rgba(var(--bg-light-rgb), 0.05);
    border: 1px solid rgba(var(--bg-light-rgb), 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.btn-back:hover {
    color: var(--text-light);
    background: rgba(var(--bg-light-rgb), 0.1);
    transform: translateX(-4px);
}

.set-actions {
    display: flex;
    gap: 8px;
}

.btn-icon-action {
    background: rgba(var(--bg-light-rgb), 0.05);
    border: 1px solid rgba(var(--bg-light-rgb), 0.1);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
}

.btn-icon-action:hover {
    background: rgba(var(--bg-light-rgb), 0.15);
    color: var(--text-light);
    transform: translateY(-2px);
    border-color: rgba(var(--primary-rgb), 0.4);
}


.set-main-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.set-main-info h1 {
    font-size: 3em;
    font-weight: 800;
    color: var(--text-light);
    letter-spacing: -1px;
    line-height: 1.1;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    margin: 0;
}

.set-badges {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.set-badge {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.3);
}

#set-folder-badge {
    background: rgba(var(--blue-accent-rgb), 0.15);
    color: var(--blue-accent);
    box-shadow: inset 0 0 0 1px rgba(var(--blue-accent-rgb), 0.3);
}

.set-description {
    color: var(--text-muted);
    font-size: 1.15em;
    line-height: 1.6;
    max-width: 800px;
}

.set-meta {
    display: flex;
    gap: 32px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.9em;
    font-weight: 500;
}


.learn-hero-action {
    display: flex;
    justify-content: flex-end;
}

.learn-wrapper {
    position: relative;
    display: inline-block;
}

.btn-primary-glow {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.8), rgba(var(--primary-rgb), 1));
    color: white;
    padding: 16px 32px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 1.1em;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary-glow:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 40px rgba(var(--primary-rgb), 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary-glow .material-symbols-rounded {
    font-size: 24px;
}

.learn-menu-glass {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    left: auto;
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    border-radius: 16px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 240px;
    max-height: 0px;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.95);
    transform-origin: top right;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 9999;
}

.learn-menu-glass.open {
    max-height: 400px !important;
    opacity: 1 !important;
    transform: scale(1) !important;
    pointer-events: auto !important;
}

.learn-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 600;
    transition: all 0.2s ease;
}

.learn-option:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.learn-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}


.terms-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: setAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.1s;
    opacity: 0;
}

.terms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terms-header h2 {
    font-size: 1.8em;
    font-weight: 700;
    margin: 0;
}

.search-box {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-radius: 100px;
    gap: 12px;
    width: 100%;
    max-width: 350px;
    background: rgba(var(--bg-light-rgb), 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: rgba(var(--primary-rgb), 0.5);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
    background: rgba(var(--bg-light-rgb), 0.08);
}

.search-icon {
    color: var(--text-muted);
    font-size: 20px;
}

#search-input {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1em;
    width: 100%;
    outline: none;
}

#search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}


.terms-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.term-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: 
        "number term star"
        "number def star";
    align-items: center;
    padding: 24px;
    border-radius: 20px;
    background: rgba(var(--bg-light-rgb), 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    gap: 16px 24px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.term-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.term-card:hover {
    transform: translateY(-4px);
    background: rgba(var(--bg-light-rgb), 0.06);
    border-color: rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.term-card:hover::before {
    opacity: 1;
}

.term-number {
    grid-area: number;
    font-size: 1.2em;
    color: var(--text-muted);
    font-weight: 800;
    opacity: 0.5;
    padding-right: 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.term-side {
    grid-area: term;
    font-size: 1.15em;
    font-weight: 600;
    color: var(--text-light);
    word-break: break-word;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.def-side {
    grid-area: def;
    font-size: 1.1em;
    color: var(--text-muted);
    word-break: break-word;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.btn-speak {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.5;
}

.term-card:hover .btn-speak {
    opacity: 1;
}

.btn-speak:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
    transform: scale(1.1);
}

.btn-star-card {
    grid-area: star;
    background: rgba(var(--bg-light-rgb), 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    align-self: center;
}

.btn-star-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1) rotate(15deg);
    border-color: rgba(255, 255, 255, 0.2);
}