:root {
    --primary: #00badf;
    --primary-hover: #00b22cf6;
    --accent: #fb00ff;
    --transition-speed: 0.3s;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f1f5f9;
    --text-dim: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(15, 23, 42, 0.5);
    --badge-bg: rgba(129, 140, 248, 0.15);
    --extra-bg: rgba(15, 23, 42, 0.3);
}

[data-theme="light"] {
    --bg-color: #f0f2ff;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-main: #1e293b;
    --text-dim: #64748b;
    --glass-border: rgba(99, 102, 241, 0.1);
    --input-bg: rgba(255, 255, 255, 0.9);
    --badge-bg: rgba(129, 140, 248, 0.1);
    --extra-bg: rgba(241, 245, 249, 0.8);
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(80px);
}

.blob {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    opacity: 0.15;
}

.blob-1 {
    background: var(--primary);
    top: -100px;
    right: -100px;
    animation: move 20s infinite alternate;
}

.blob-2 {
    background: var(--accent);
    bottom: -100px;
    left: -100px;
    animation: move 25s infinite alternate-reverse;
}

@keyframes move {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(50px, 100px);
    }
}

.container {
    width: 90%;
    max-width: 600px;
    padding: 40px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    z-index: 10;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

header {
    margin-bottom: 30px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -1.5px;
}

header h1 span {
    color: var(--primary);
}

header p {
    color: var(--text-dim);
    font-size: 1rem;
    font-weight: 400;
}

.theme-btn {
    width: 45px;
    height: 45px;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    background: var(--input-bg);
    color: var(--text-main);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    transform: rotate(15deg) scale(1.1);
    background: var(--primary);
    color: white;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

.input-wrapper {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}

.search-box input {
    width: 100%;
    padding: 16px 16px 16px 50px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.2);
}

.search-box button {
    padding: 0 28px;
    background: var(--primary);
    border: none;
    border-radius: 16px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
}

.search-box button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(129, 140, 248, 0.4);
}

.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

.welcome-message {
    text-align: center;
    padding: 60px 0;
    color: var(--text-dim);
}

.welcome-message i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--primary);
    opacity: 0.6;
}

.word-card {
    border-top: 1px solid var(--glass-border);
    padding-top: 30px;
}

.word-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
}

.word-header h3 {
    font-size: 2.5rem;
    text-transform: capitalize;
    font-weight: 700;
    line-height: 1;
}

.pos-badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--badge-bg);
    color: var(--primary);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: lowercase;
    margin-top: 10px;
    font-style: italic;
}

.speak-btn {
    width: 55px;
    height: 55px;
    border-radius: 18px;
    border: 1px solid var(--glass-border);
    background: var(--input-bg);
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
}

.speak-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.primary-meaning {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 30px;
    font-weight: 400;
}

.extra-defs {
    background: var(--extra-bg);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.extra-defs h4 {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.extra-defs ul {
    list-style: none;
}

.extra-defs li {
    margin-bottom: 15px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.extra-defs li:last-child {
    margin-bottom: 0;
}

.mini-pos {
    background: var(--badge-bg);
    color: var(--primary);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: lowercase;
    margin-top: 3px;
    white-space: nowrap;
    font-style: italic;
}

.mini-text {
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.5;
}

.loading {
    text-align: center;
    padding: 30px;
    color: var(--text-dim);
    font-size: 1.1rem;
}

.error-card {
    text-align: center;
    padding: 50px 0;
}

.error-icon {
    font-size: 3.5rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.error-card h3 {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.error-card p {
    color: var(--text-dim);
}

@media (max-width: 480px) {
    .container {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 2.2rem;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box button {
        padding: 16px;
    }

    .word-header h3 {
        font-size: 2rem;
    }
}