:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #151b3d;
    --accent-primary: #00ffb9;
    --accent-secondary: #7b2cbf;
    --text-primary: #f0f4f8;
    --text-secondary: #a8b2c1;
    --card-bg: rgba(21, 27, 61, 0.6);
    --border-color: rgba(0, 255, 185, 0.15);
    --color-free: #2ecc71;
    --color-freemium: #f1c40f;
}

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

body {
    font-family: 'Work Sans', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.background-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(circle at 20% 50%, rgba(123, 44, 191, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 255, 185, 0.1) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.05); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -2px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
    max-width: 750px;
    margin: 0 auto;
}

.search-container {
    margin-bottom: 50px;
    animation: fadeIn 1s ease-out 0.2s both;
}

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

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

#searchInput {
    width: 100%;
    padding: 18px 50px 18px 24px;
    font-size: 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-primary);
    font-family: 'Work Sans', sans-serif;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#searchInput:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 30px rgba(0, 255, 185, 0.2);
}

#searchInput::placeholder {
    color: var(--text-secondary);
}

.search-icon {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 50px;
    animation: fadeIn 1s ease-out 0.4s both;
}

.category-btn {
    padding: 12px 28px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.category-btn:hover,
.category-btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 185, 0.3);
}

.results-counter {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.bookmark-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out both;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.bookmark-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 185, 0.1), transparent);
    transition: left 0.5s ease;
}

.bookmark-card:hover::before {
    left: 100%;
}

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

.bookmark-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 60px rgba(0, 255, 185, 0.15);
}

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

.bookmark-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-secondary);
    object-fit: contain;
    flex-shrink: 0;
}

.bookmark-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.bookmark-category {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(0, 255, 185, 0.1);
    border: 1px solid var(--accent-primary);
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bookmark-category:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.bookmark-pricing {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bookmark-pricing.free {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid var(--color-free);
    color: var(--color-free);
}

.bookmark-pricing.freemium {
    background: rgba(241, 196, 15, 0.15);
    border: 1px solid var(--color-freemium);
    color: var(--color-freemium);
}

.bookmark-recommended {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 4px 10px;
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid #ff6b6b;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ff6b6b;
}

.bookmark-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.bookmark-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.bookmark-link {
    display: inline-flex;
    align-items: center;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.bookmark-link:hover {
    gap: 8px;
    color: var(--text-primary);
}

.bookmark-link::after {
    content: '→';
    margin-left: 8px;
    transition: margin-left 0.3s ease;
}

.bookmark-link:hover::after {
    margin-left: 12px;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}

.top-right-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100;
}

.language-selector {
    display: flex;
    gap: 8px;
}

.lang-btn {
    padding: 8px 16px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lang-btn:hover,
.lang-btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.suggest-btn {
    margin-top: 20px;
    padding: 12px 28px;
    background: var(--card-bg);
    border: 2px solid var(--accent-primary);
    border-radius: 25px;
    color: var(--accent-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
}

.suggest-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 185, 0.3);
}

@media (max-width: 768px) {
    .bookmarks-grid {
        grid-template-columns: 1fr;
    }
}

/* Dictionary Button */
.dictionary-btn {
    padding: 8px 20px;
    background: var(--card-bg);
    border: 2px solid var(--accent-secondary);
    border-radius: 25px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
}

.dictionary-btn:hover {
    background: var(--accent-secondary);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(123, 44, 191, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-content {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    transform: translateY(20px);
    animation: modalSlideIn 0.3s ease forwards;
}

@keyframes modalSlideIn {
    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}

.modal-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    color: var(--accent-primary);
}

.modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    max-height: calc(85vh - 90px);
}

/* Dictionary Accordion */
.dict-section {
    margin-bottom: 16px;
}

.dict-accordion {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.dict-accordion:hover {
    border-color: var(--accent-primary);
}

.dict-accordion.active {
    border-color: var(--accent-primary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.dict-icon {
    font-size: 1.4rem;
}

.dict-title {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
}

.dict-arrow {
    font-size: 0.8rem;
    color: var(--accent-primary);
    transition: transform 0.3s ease;
}

.dict-accordion.active .dict-arrow {
    transform: rotate(180deg);
}

.dict-panel {
    max-height: 0;
    overflow: hidden;
    background: var(--card-bg);
    border: 2px solid var(--accent-primary);
    border-top: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    transition: max-height 0.3s ease;
}

.dict-intro {
    padding: 16px 20px 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
}

.dict-terms {
    padding: 8px 20px 20px;
}

.dict-terms dt {
    color: var(--accent-primary);
    font-weight: 600;
    margin-top: 12px;
    font-size: 0.95rem;
}

.dict-terms dd {
    color: var(--text-secondary);
    margin-left: 0;
    margin-top: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 18px 20px;
    }

    .modal-body {
        padding: 18px 20px;
    }

    .dict-accordion {
        padding: 14px 16px;
    }

    .dict-title {
        font-size: 0.9rem;
    }
}