:root {
    --bg-black: #0f0a15;
    --deep-purple: #1a1025;
    --light-purple: #4a2b5d;
    --accent-purple: #9d50bb;
    --text-main: #eaddff;
    --text-dim: #9b8ab0;
    --border-color: #352145;
    --red: #c01c28;
    --blue: #3584e4;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-black);
    color: var(--text-main);
    font-family: "Cantarell", -apple-system, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* NAVBAR */
.navbar {
    background: rgba(15, 10, 21, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    display: flex;
    align-items: center;
    padding: 10px 20px;
    position: fixed;
    top: 0;
    z-index: 1030;
    height: 70px;
}

.navl a {
    color: var(--text-main);
    text-decoration: none;
    white-space: nowrap;
}

.navr {
    margin-left: auto;
}

.navbar ul {
    list-style: none;
    display: flex;
}

.navbar li {
    margin-left: 15px;
}

.nav-btn {
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-btn:hover, .nav-btn.active {
    color: var(--accent-purple);
}

/* MAIN CONTENT */
#app-content {
    margin-top: 70px;
    flex: 1;
    padding-bottom: 100px;
}

.clamped-view {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

.hero-text {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    margin: 32px 0;
}

/* SEARCH AREA */
.search-area {
    position: sticky;
    top: 15px; /* Dock into the navbar center (70px height, 40px input) */
    z-index: 1040;
    margin-bottom: 20px;
    max-width: 600px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.search-inp-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#search-input {
    width: 100%;
    height: 40px;
    background: var(--deep-purple);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0 16px;
    color: var(--text-main);
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#search-input:focus {
    border-color: var(--accent-purple);
}

.clean-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dim);
    display: flex;
    align-items: center;
}

/* HINT POPOVER */
.hint-popover {
    position: absolute;
    top: 45px;
    left: 0;
    right: 0;
    background: var(--deep-purple);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    overflow: hidden;
}

.hint-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}

.hint-item:hover, .hint-item.active {
    background: var(--light-purple);
}

/* SUGGEST AREA */
.suggest-area {
    background: var(--deep-purple);
    border-radius: 12px;
    padding: 16px;
    margin-top: 20px;
    list-style: none;
}

.suggest-area h2 {
    font-size: 18px;
    margin-bottom: 10px;
    text-align: center;
}

.suggest-item {
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.suggest-item:hover, .suggest-item.active {
    background: var(--light-purple);
}

/* TABLE AREA */
.table-area {
    background: var(--deep-purple);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 20px;
}

.wordbook-table {
    width: 100%;
    border-collapse: collapse;
}

.wordbook-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--light-purple);
    font-size: 14px;
    color: var(--text-dim);
}

.wordbook-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.wordbook-table tr:last-child td {
    border-bottom: none;
}

.wordbook-table .word {
    font-weight: 600;
}

.wordbook-table .category {
    font-size: 12px;
    color: var(--text-dim);
}

/* CHECKBOX */
.checkbox-wrapper {
    display: inline-block;
    cursor: pointer;
}

.checkbox-wrapper input {
    display: none;
}

.checkbox-style {
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-purple);
    border-radius: 50%;
    transition: background 0.2s;
}

.checkbox-wrapper input:checked + .checkbox-style {
    background: var(--accent-purple);
}

.checkbox-wrapper input:disabled + .checkbox-style {
    border-color: var(--text-dim);
    background: var(--text-dim);
    opacity: 0.5;
}

/* SELECTION BAR */
.selection-bar {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 16, 37, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--accent-purple);
    border-radius: 30px;
    padding: 10px 20px;
    display: flex;
    gap: 20px;
    z-index: 2000;
    transition: opacity 0.3s, visibility 0.3s;
}

.selection-bar.hidden {
    opacity: 0;
    visibility: hidden;
}

.selection-bar button {
    background: none;
    border: none;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
}

.redtx { color: var(--red); }
.bluetx { color: var(--blue); }

/* BOTTOM NAV */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: var(--deep-purple);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1030;
}

.bottom-nav .nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
}

.bottom-nav .nav-icon {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

/* SETTINGS */
.setting-item {
    background: var(--deep-purple);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-md {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btr { background-color: var(--red); color: white; }
.btb { background-color: var(--blue); color: white; }

.btn-md:hover { opacity: 0.8; }

/* UTILS */
.hidden { display: none !important; }

.list-empty {
    text-align: center;
    margin-top: 100px;
    color: var(--text-dim);
}

/* RESPONSIVE */
@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
    
    .selection-bar {
        bottom: 20px;
    }
}

@media (max-width: 768px) {
    .navbar {
        display: none;
    }
    #app-content {
        margin-top: 0px;
    }
    .search-area {
        top: 0px; /* Dock at top on mobile */
        max-width: 100%;
        background: var(--bg-black);
        padding: 10px 16px;
        margin-bottom: 0;
    }
    .hero-text {
        margin: 20px 0;
    }
}
