/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #3d3327;
    background-color: #f6f1e7;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.btn-primary {
    background-color: #9c5a2b;
    color: white;
}

.btn-primary:hover {
    background-color: #7c4520;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #5c4a36;
    color: white;
}

.btn-secondary:hover {
    background-color: #4a3b2b;
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    color: #9c5a2b;
    border: 2px solid #9c5a2b;
}

.btn-outline:hover {
    background-color: #9c5a2b;
    color: white;
    transform: translateY(-1px);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

/* Header */
.header {
    background-color: #fffcf5;
    box-shadow: 0 2px 12px rgba(60, 45, 25, 0.12);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.brand-title {
    font-family: 'Rye', 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: #6e4a24;
    margin: 0;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #8a7860;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #9c5a2b;
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.username {
    font-weight: 500;
    color: #333;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #fffcf5;
    border: 1px solid #e3d9c6;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(60, 45, 25, 0.18);
    min-width: 200px;
    z-index: 1000;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f7f1e4;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Sections */
.section {
    padding: 4rem 0;
}

.section-hero {
    background: linear-gradient(135deg, #2d2115 0%, #4a3320 55%, #6b4423 100%);
    color: #f3e8d5;
    padding: 6rem 0;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: #f3e8d5;
}

.hero-subtitle {
    font-size: 1.15rem;
    margin-bottom: 2rem;
    opacity: 0.85;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.hero-image {
    text-align: center;
}

.hero-image img {
    display: block;
    width: 100%;
    height: 440px;
    object-fit: cover;
    object-position: center 48%;
    border-radius: 8px;
    border: 1px solid #e3d9c6;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.cocktail-placeholder {
    font-size: 8rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Search Section */
.section-search {
    background-color: #fffcf5;
    padding: 2rem 0;
    border-bottom: 1px solid #e3d9c6;
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-box {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #d8cbb2;
    border-radius: 4px;
    font-size: 1rem;
    background-color: #fffcf5;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #9c5a2b;
}

.filter-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 1px solid #d8cbb2;
    border-radius: 4px;
    font-size: 0.875rem;
    background-color: #fffcf5;
    cursor: pointer;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    color: #33291d;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: #8a7860;
    font-size: 1.125rem;
}

/* Cocktails Grid */
.cocktails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.cocktail-card {
    background-color: #fffcf5;
    border: 1px solid #e9dfcc;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 14px rgba(60, 45, 25, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.cocktail-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(60, 45, 25, 0.18);
}

.cocktail-image {
    height: 200px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, #6b4423 0%, #3a2a1b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

.cocktail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cocktail-content {
    padding: 1.5rem;
}

.cocktail-name {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #33291d;
}

.cocktail-description {
    color: #8a7860;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cocktail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.badge {
    background-color: #f1e8d5;
    border: 1px solid #e0d3b8;
    color: #6e5a41;
    padding: 0.25rem 0.6rem;
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cocktail-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #8a7860;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #efe7d8;
    border-top: 4px solid #9c5a2b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
    /* whiskey amber accent */
}

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

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination button {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e3d9c6;
    background-color: #fffcf5;
    color: #6e5a41;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination button:hover {
    background-color: #f7f1e4;
}

.pagination button.active {
    background-color: #9c5a2b;
    color: white;
    border-color: #9c5a2b;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Ingredients Section */
.ingredients-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.ingredients-sidebar {
    background-color: #fffcf5;
    border: 1px solid #e9dfcc;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(60, 45, 25, 0.1);
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #8a7860;
}

.category-item:hover,
.category-item.active {
    background-color: #efe7d8;
    color: #9c5a2b;
}

.ingredients-content {
    background-color: #fffcf5;
    border: 1px solid #e9dfcc;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(60, 45, 25, 0.1);
}

.ingredients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.ingredient-card {
    padding: 1rem;
    border: 2px solid #e3d9c6;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s ease;
}

.ingredient-card:hover {
    border-color: #9c5a2b;
    background-color: #f7f1e4;
}

.ingredient-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.ingredient-category {
    font-size: 0.75rem;
    color: #8a7860;
}

.ingredient-card-actions { display: flex; flex-direction: column; gap: .5rem; margin-top: .9rem; }
.ingredient-card-actions .btn { width: 100%; padding: .55rem .65rem; font-size: .85rem; }
.ingredient-card-actions .btn:disabled { opacity: .65; cursor: default; }
.ingredient-cocktails { margin-top: 1.5rem; padding: 1.25rem; border: 1px solid #e3d9c6; border-radius: 8px; background: #f7f1e4; scroll-margin-top: 6rem; }
.ingredient-cocktails[hidden] { display: none; }
.ingredient-cocktails-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.ingredient-cocktails-header h3 { margin: 0; }
.ingredient-cocktails-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: .65rem; }
.ingredient-cocktail-result { display: flex; flex-direction: column; gap: .3rem; text-align: left; padding: .85rem; border: 1px solid #d5c3a8; border-radius: 7px; background: #fffcf5; color: #33291d; cursor: pointer; }
.ingredient-cocktail-result:hover, .ingredient-cocktail-result:focus-visible { border-color: #9c5a2b; background: #fff; }
.ingredient-cocktail-result span { font-size: .8rem; color: #8a7860; }
.ingredient-cocktails-pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }

/* My Bar Section */
.my-bar-container {
    background-color: #fffcf5;
    border: 1px solid #e9dfcc;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(60, 45, 25, 0.1);
}

.my-bar-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #3a2a1b 0%, #6b4423 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #4a3320;
    text-align: center;
}

.stat-card h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-card p {
    opacity: 0.9;
}

.my-bar-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.my-ingredients-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.user-ingredient-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e3d9c6;
    border-radius: 8px;
    background-color: #f7f1e4;
}

.user-ingredient-info h4 {
    margin-bottom: 0.25rem;
    color: #33291d;
}

.user-ingredient-info p {
    font-size: 0.875rem;
    color: #8a7860;
    margin: 0;
}

.remove-ingredient {
    background-color: #a04030;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.suggestions-container {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e3d9c6;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: #fffaf0;
    border: 1px solid #e3d9c6;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e3d9c6;
}

.modal-title {
    margin: 0;
    color: #33291d;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #8a7860;
    padding: 0.5rem;
}

.modal-body {
    padding: 1.5rem;
}

/* Cocktail Detail */
.cocktail-detail {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cocktail-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cocktail-description {
    color: #8a7860;
    line-height: 1.6;
}

.ingredients-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ingredients-list li {
    padding: 0.5rem;
    background-color: #f7f1e4;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
}

.instructions {
    line-height: 1.6;
    white-space: pre-line;
}

.cocktail-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.review {
    padding: 1rem;
    background-color: #f7f1e4;
    border-radius: 8px;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.review-author {
    font-weight: 500;
    color: #33291d;
}

.review-rating {
    color: #c08a3d;
}

.review-comment {
    color: #8a7860;
    font-size: 0.875rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4a3d2c;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d8cbb2;
    border-radius: 4px;
    font-size: 0.875rem;
    background-color: #fffcf5;
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #9c5a2b;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
}

.auth-switch a {
    color: #9c5a2b;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Search Results */
.search-results {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e3d9c6;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.search-result-item {
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: #f7f1e4;
}

.selected-ingredient {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f7f1e4;
    border-radius: 8px;
}

/* Footer */
.footer {
    background-color: #241b11;
    color: #e8dcc8;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
    color: #b5a48f;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #3a2e1f;
    color: #a5937a;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-list {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hero-image img {
        height: 280px;
    }
    
    .cocktails-grid {
        grid-template-columns: 1fr;
    }
    
    .ingredients-container {
        grid-template-columns: 1fr;
    }
    
    .my-bar-stats {
        grid-template-columns: 1fr;
    }
    
    .my-bar-actions {
        flex-direction: column;
    }
    
    .cocktail-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cocktail-actions {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .nav-auth {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.hidden { display: none; }
.show { display: block; }

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* ===== Drink detail (variants) ===== */
.drink-modal .modal-wide{max-width:940px;width:95%;}
.modal-wide{max-width:720px !important;}
.drink-head{display:flex;flex-direction:column;gap:6px;}
.drink-variant-count{font-size:.92em;color:#b98a4e;font-style:italic;}
.drink-layout{display:grid;grid-template-columns:270px 1fr;gap:26px;align-items:start;}
@media(max-width:700px){.drink-layout{grid-template-columns:1fr;gap:16px;}}
.drink-variants{border-right:1px solid rgba(185,138,78,.25);padding-right:20px;}
@media(max-width:700px){.drink-variants{border-right:none;border-bottom:1px solid rgba(185,138,78,.25);padding:0 0 16px;}}
.drink-variants h4{margin:0 0 4px;}
.variant-list{list-style:none;margin:10px 0 0;padding:0;max-height:46vh;overflow-y:auto;}
.variant-list li{padding:10px 12px;border-radius:9px;cursor:pointer;margin-bottom:6px;border:1px solid transparent;transition:background .15s,border-color .15s;}
.variant-list li:hover{background:rgba(185,138,78,.10);}
.variant-list li.active{background:rgba(185,138,78,.16);border-color:#b98a4e;}
.variant-list .v-name{font-weight:600;font-size:.98em;}
.drink-variant-name{margin:10px 0 4px;font-size:1.25em;}
.drink-variant-meta{display:flex;flex-wrap:wrap;gap:8px;margin:6px 0 14px;}
.variants-count-badge{background:rgba(185,138,78,.18);color:#e8c89a;border:1px solid rgba(185,138,78,.4);margin-left:8px;}
.ingredients-list li .ing-amount{font-weight:600;}

/* Pantry choices use real buttons for keyboard and touch selection. */
button.search-result-item { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: transparent; border: 0; border-bottom: 1px solid var(--border-color, #ddd); }
button.search-result-item:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }
.pantry-choice-hint { display: block; font-size: .85rem; opacity: .75; margin-top: .25rem; }
.custom-bottle-form { margin-top: 1rem; border-top: 1px solid var(--border-color, #ddd); padding-top: 1rem; }
.custom-bottle-form summary { cursor: pointer; margin-bottom: .75rem; }
.bottle-swap-toggle { display: flex; gap: .65rem; align-items: center; margin: 1rem 0 .25rem; }
.bottle-choice { display: block; margin: .7rem 0; font-size: .85rem; }
.bottle-choice select { display: block; width: 100%; min-width: 0; margin: .35rem 0; }
.bottle-choice-status { display: block; opacity: .85; }
.bottle-swap-note { color: var(--accent-color, #b98a4e); font-weight: 600; margin: .5rem 0; }
.ingredients-list li > div { width: 100%; min-width: 0; }

@media (max-width: 768px) { .filter-select { min-width: 0; max-width: 100%; } }
