:root {
    --bg-deep: #0f0a1a;
    --wine-dark: #2d132c;
    --wine-mid: #801336;
    --wine-bright: #c72c41;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --accent-blue: #4c8bf5;
    --accent-green: #4ade80;
    --blur-radius: 20px;
    --rounding: 20px;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-deep);
    background-image: radial-gradient(circle at 50% 0%, var(--wine-dark) 0%, var(--bg-deep) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background Animated Blobs */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 300px;
    height: 300px;
    background: var(--wine-mid);
    top: -50px;
    left: -50px;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: #4c1d95;
    bottom: 10%;
    right: -50px;
    animation-delay: -5s;
}

.blob-3 {
    width: 250px;
    height: 250px;
    background: var(--wine-bright);
    top: 40%;
    left: 50%;
    opacity: 0.2;
}

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

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

#app {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    padding: 10px;
    min-height: 100vh;
}

.screen {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

/* SEARCH BAR */
.search-container {
    position: relative;
    margin-bottom: 25px;
    width: 100%;
}

#search-input {
    width: 100%;
    padding: 14px 45px 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(76, 139, 245, 0.2);
}

.clear-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    display: none;
    padding: 5px;
    line-height: 1;
}

.clear-btn.active {
    display: block;
}

#categories-list.search-results {
    /* Reverts to default grid layout from .grid-container */
}

#loader {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80vh;
    text-align: center;
}

.screen.active {
    display: block;
}

#loader.active {
    display: flex;
}

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

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

/* Glass Header */
.glass-header {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-radius));
    -webkit-backdrop-filter: blur(var(--blur-radius));
    border: 1px solid var(--glass-border);
    padding: 20px;
    border-radius: var(--rounding);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--wine-bright), var(--accent-blue));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(199, 44, 65, 0.4);
}

.brand {
    margin: 0;
    font-size: 18px;
    letter-spacing: 0.5px;
}

.subtitle {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.logo img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--glass-border);
}

/* Monitoring Bar */
.monitoring-bar {
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-radius));
    -webkit-backdrop-filter: blur(var(--blur-radius));
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 12px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 17px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.monitoring-bar:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.08);
}

.pulse-icon {
    width: 8px;
    height: 8px;
    background: var(--accent-blue);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 10px var(--accent-blue);
}

.pulse-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--accent-blue);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(3.5);
        opacity: 0;
    }
}

.arrow-icon {
    margin-left: auto;
    opacity: 0.5;
    font-size: 18px;
}

.tracked-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
    opacity: 0.8;
}

/* Grid and Cards */
.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-radius));
    -webkit-backdrop-filter: blur(var(--blur-radius));
    border: 1px solid var(--glass-border);
    border-radius: var(--rounding);
    padding: 15px;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.card:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.1);
}

.card img {
    width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 80%);
}

.card-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Category Cards specific */
#categories-list .card {
    padding: 25px 15px;
}

#categories-list .card .icon-label {
    font-size: 44px;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

/* Buttons */
.action-btn {
    background: linear-gradient(135deg, var(--wine-mid), var(--wine-bright));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 14px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(128, 19, 54, 0.4);
    transition: all 0.2s;
}

.action-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.action-btn:disabled {
    background: #444;
    box-shadow: none;
    border-color: transparent;
}

.back-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-radius));
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: var(--wine-dark);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--blur-radius));
    padding: 30px;
    border-radius: 24px;
    width: 100%;
    max-width: 340px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-content img {
    max-width: 220px;
    margin-bottom: 20px;
    background: radial-gradient(circle, rgba(199, 44, 65, 0.15) 0%, transparent 70%);
}

#modal-price {
    font-size: 20px;
    font-weight: 700;
    margin: 15px 0 25px 0;
    color: var(--accent-green);
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    opacity: 0.5;
    cursor: pointer;
}

/* Loader & Pagination */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid var(--wine-bright);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
    padding-bottom: 30px;
    align-items: center;
}

.pagination button {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 8px 15px;
    border-radius: 10px;
}

.pagination button:disabled {
    opacity: 0.3;
}

/* Section Titles */
h2 {
    font-size: 22px;
    margin: 0 0 15px 5px;
    font-weight: 600;
}

h3 {
    margin-bottom: 20px;
    font-weight: 600;
}