:root {
    --bg-color: #020617;
    --text-color: #f1f5f9;
    --card-bg: #0f172a;
    --primary-gradient: linear-gradient(135deg, #8b5cf6, #d946ef);
    --hover-gradient: linear-gradient(135deg, #7c3aed, #c026d3);
    --accent: #f43f5e;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --card-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --secondary-text: #334155;
    --card-bg: rgba(255, 255, 255, 0.9);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body[data-theme="light"] {
    background-color: #f0f7ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.5s ease;
    overflow-x: hidden;
    min-height: 100vh;
}

.fade-in {
    animation: fadeIn 0.8s ease-out;
}

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

.hidden {
    display: none !important;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 8%;
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .navbar {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #e2e8f0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    cursor: pointer;
}

.logo span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.theme-toggle {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    color: inherit;
    transition: var(--transition);
}

.hero {
    padding: 8rem 8% 10rem 8%;
    text-align: center;
    background: linear-gradient(rgba(2, 6, 23, 0.7), rgba(2, 6, 23, 0.7)), url('hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

[data-theme="light"] .hero {
    background: linear-gradient(rgba(200, 225, 255, 0.4), rgba(200, 225, 255, 0.4)), url('hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 1rem;
    animation: fadeIn 1s ease-out;
}

[data-theme="light"] .hero h1 {
    color: #0c1221;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.5);
}

.hero p {
    font-size: 1.3rem;
    opacity: 0.7;
    margin-bottom: 4rem;
    animation: fadeIn 1.2s ease-out;
}

[data-theme="light"] .hero p {
    color: #1e293b;
    font-weight: 600;
    opacity: 1;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.hero-content {
    animation: fadeIn 0.8s ease-out;
}

.category-cards {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.cat-card {
    background: var(--card-bg);
    padding: 0;
    border-radius: 32px;
    width: 280px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow);
    overflow: hidden;
}

[data-theme="light"] .cat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.cat-img-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.cat-img-wrapper::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.2));
}

.cat-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cat-card:hover .cat-img-wrapper img {
    transform: scale(1.1);
}

.cat-info {
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.cat-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: var(--card-shadow);
    border-color: #8b5cf6;
}

.cat-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.cat-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.cat-card p {
    font-size: 0.9rem;
    opacity: 0.6;
    margin-bottom: 0;
}

.main-content {
    padding: 4rem 8% 8rem 8%;
    transition: all 0.5s ease;
    min-height: 100vh;
}

.main-content.bg-alcoholic {
    background: linear-gradient(rgba(2, 6, 23, 0.85), rgba(2, 6, 23, 0.85)), url('hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    animation: fadeIn 0.8s ease-out;
}

.main-content.bg-non-alcoholic {
    background: linear-gradient(rgba(2, 6, 23, 0.85), rgba(2, 6, 23, 0.85)), url('non-alcoholic-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    animation: fadeIn 0.8s ease-out;
}

.main-content.bg-favorites {
    background: linear-gradient(rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.9)), url('non-alcoholic-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

[data-theme="light"] .main-content.bg-alcoholic {
    background: linear-gradient(rgba(200, 225, 255, 0.45), rgba(200, 225, 255, 0.45)), url('hero-bg.jpg');
    background-size: cover;
    background-attachment: fixed;
}

[data-theme="light"] .main-content.bg-non-alcoholic {
    background: linear-gradient(rgba(200, 225, 255, 0.45), rgba(200, 225, 255, 0.45)), url('non-alcoholic-bg.jpg');
    background-size: cover;
    background-attachment: fixed;
}

.controls-wrapper {
    max-width: 1200px;
    margin: 0 auto 3rem auto;
}

.back-btn {
    background: transparent;
    color: inherit;
    border: none;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 2rem;
    opacity: 0.7;
    transition: var(--transition);
}

.back-btn:hover {
    opacity: 1;
    transform: translateX(-5px);
}

.search-container {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 24px;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

[data-theme="light"] .search-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    color: inherit;
    flex: 1;
    outline: none;
    font-size: 1rem;
    transition: var(--transition);
}

[data-theme="light"] input {
    background: rgba(0, 0, 0, 0.02);
}

input:focus {
    border-color: #8b5cf6;
    background: transparent;
}

.button-group {
    display: flex;
    gap: 1rem;
}

button {
    padding: 0.8rem 1.5rem;
    border-radius: 14px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.secondary-btn {
    background: #cbd5e1;
    color: #0f172a;
}

body:not([data-theme="light"]) .secondary-btn {
    background: #1e293b;
    color: #f1f5f9;
}

.accent-btn {
    background: var(--primary-gradient);
    color: white;
}

button:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

#section-title {
    font-size: 2.5rem;
    margin-top: 1rem;
}

[data-theme="light"] #section-title {
    color: #0c1221;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.5);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
}

.drink-card {
    background: var(--card-bg);
    border-radius: 28px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow);
}

[data-theme="light"] .drink-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.drink-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--card-shadow);
}

.drink-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.card-info {
    padding: 1.5rem;
    text-align: center;
}

.card-info h3 {
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.card-info p {
    opacity: 0.6;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.card-btns {
    display: flex;
    gap: 0.8rem;
}

.card-btns button {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.7rem;
}

.details-btn {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.fav-button {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
}

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

.modal-box {
    background: var(--card-bg);
    border-radius: 32px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
    animation: modalIn 0.3s ease-out;
}

[data-theme="light"] .modal-box {
    background: #f0f7ff;
    color: #0f172a;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.close-modal {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    font-size: 1.5rem;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
}

.site-footer {
    padding: 3rem;
    text-align: center;
    opacity: 0.6;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .site-footer {
    color: #0f172a;
    opacity: 0.8;
    border-top: 1px solid #e2e8f0;
}

.loader-text {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .hero h1 { font-size: 3rem; }
    .search-container { flex-direction: column; }
    .button-group { width: 100%; }
    .button-group button { flex: 1; }
}
