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

body {
    font-family: 'Nunito', sans-serif;
    background: 
        radial-gradient(circle at 25% 25%, rgba(255, 193, 7, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 138, 76, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #2c1810 0%, #4a2c17 25%, #6d3e1a 50%, #8b4513 75%, #a0522d 100%);
    min-height: 100vh;
    padding: 20px;
    background-attachment: fixed;
}

/* Prevent background scrolling when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(255,193,7,0.05) 2px, rgba(255,193,7,0.05) 4px),
        radial-gradient(circle at 20% 80%, rgba(255,193,7,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,138,76,0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.bubbles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    background: radial-gradient(circle, rgba(255, 248, 220, 0.8) 0%, rgba(255, 193, 7, 0.3) 70%, transparent 100%);
    border-radius: 50%;
    animation: float-up linear infinite;
    opacity: 0;
}

.bubble::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 25%;
    width: 30%;
    height: 30%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    filter: blur(1px);
}

@keyframes float-up {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.6;
        transform: translateY(90vh) scale(1);
    }
    90% {
        opacity: 0.6;
        transform: translateY(10vh) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-10vh) scale(0.5);
    }
}

.bubble:nth-child(1) { left: 5%; animation-duration: 15s; animation-delay: 0s; width: 8px; height: 8px; }
.bubble:nth-child(2) { left: 15%; animation-duration: 18s; animation-delay: 2s; width: 6px; height: 6px; }
.bubble:nth-child(3) { left: 25%; animation-duration: 12s; animation-delay: 4s; width: 10px; height: 10px; }
.bubble:nth-child(4) { left: 35%; animation-duration: 20s; animation-delay: 1s; width: 7px; height: 7px; }
.bubble:nth-child(5) { left: 45%; animation-duration: 16s; animation-delay: 5s; width: 9px; height: 9px; }
.bubble:nth-child(6) { left: 55%; animation-duration: 14s; animation-delay: 3s; width: 5px; height: 5px; }
.bubble:nth-child(7) { left: 65%; animation-duration: 19s; animation-delay: 6s; width: 8px; height: 8px; }
.bubble:nth-child(8) { left: 75%; animation-duration: 13s; animation-delay: 2s; width: 6px; height: 6px; }
.bubble:nth-child(9) { left: 85%; animation-duration: 17s; animation-delay: 4s; width: 7px; height: 7px; }
.bubble:nth-child(10) { left: 95%; animation-duration: 21s; animation-delay: 1s; width: 9px; height: 9px; }
.bubble:nth-child(11) { left: 10%; animation-duration: 15s; animation-delay: 7s; width: 5px; height: 5px; }
.bubble:nth-child(12) { left: 30%; animation-duration: 18s; animation-delay: 8s; width: 8px; height: 8px; }
.bubble:nth-child(13) { left: 50%; animation-duration: 16s; animation-delay: 3s; width: 6px; height: 6px; }
.bubble:nth-child(14) { left: 70%; animation-duration: 14s; animation-delay: 9s; width: 7px; height: 7px; }
.bubble:nth-child(15) { left: 90%; animation-duration: 20s; animation-delay: 5s; width: 5px; height: 5px; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(255, 248, 220, 0.98) 0%, rgba(245, 222, 179, 0.98) 100%);
    border-radius: 25px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 193, 7, 0.3);
    position: relative;
    z-index: 2;
}

.header {
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 25%, #cd853f 50%, #daa520 75%, #ffc107 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '🍺';
    position: absolute;
    top: -20px;
    left: -20px;
    font-size: 100px;
    opacity: 0.1;
    transform: rotate(-15deg);
}

.header::after {
    content: '🍻';
    position: absolute;
    bottom: -20px;
    right: -20px;
    font-size: 80px;
    opacity: 0.1;
    transform: rotate(15deg);
}

.header .foam-bubbles {
    position: absolute;
    top: 20px;
    right: 15%;
    width: 50px;
    height: 50px;
    pointer-events: none;
}

.header .foam-bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: foam-float 3s ease-in-out infinite;
}

.header .foam-bubble:nth-child(1) {
    width: 6px;
    height: 6px;
    left: 10px;
    animation-delay: 0s;
}

.header .foam-bubble:nth-child(2) {
    width: 4px;
    height: 4px;
    left: 25px;
    animation-delay: 0.5s;
}

.header .foam-bubble:nth-child(3) {
    width: 8px;
    height: 8px;
    left: 40px;
    animation-delay: 1s;
}

@keyframes foam-float {
    0%, 100% {
        transform: translateY(0px);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-15px);
        opacity: 1;
    }
}

.header h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 
        3px 3px 6px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 193, 7, 0.3);
    position: relative;
    z-index: 1;
}

.header p {
    font-size: 1.2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    font-weight: 600;
}

.content {
    padding: 40px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="%23ffc107" opacity="0.05"/></svg>') repeat;
}

/* Section Header Styles */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid rgba(255, 193, 7, 0.3);
}

.section-header h2 {
    margin: 0;
    font-size: 2.2em;
    font-weight: 800;
    color: #8b4513;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Header Add Button Styles */
.header-add-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 50%, #d63031 100%);
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 140px;
    justify-content: center;
}

.header-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #ff7979 0%, #fd79a8 50%, #e84393 100%);
}

.header-add-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.header-add-btn .icon {
    font-size: 18px;
}

.header-add-btn .text {
    font-size: 13px;
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .header-add-btn {
        align-self: center;
        min-width: 160px;
    }
}

.form-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 248, 220, 0.9) 100%);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 35px;
    box-shadow: 
        0 15px 35px rgba(139, 69, 19, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(218, 165, 32, 0.3);
    position: relative;
    backdrop-filter: blur(5px);
}

.form-section::before {
    content: '🌾';
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    opacity: 0.3;
}

.form-section h2 {
    color: #8b4513;
    margin-bottom: 25px;
    font-size: 1.6em;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    font-family: 'Fredoka One', cursive;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

label {
    font-weight: 700;
    margin-bottom: 10px;
    color: #8b4513;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

input, select, textarea {
    padding: 15px 20px;
    border: 3px solid rgba(218, 165, 32, 0.3);
    border-radius: 15px;
    font-size: 16px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 248, 220, 0.6) 100%);
    box-shadow: inset 0 2px 4px rgba(139, 69, 19, 0.1);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #daa520;
    box-shadow: 
        0 0 0 4px rgba(218, 165, 32, 0.2),
        inset 0 2px 4px rgba(139, 69, 19, 0.1),
        0 8px 25px rgba(218, 165, 32, 0.15);
    transform: translateY(-3px);
    background: linear-gradient(135deg, #fff 0%, rgba(255, 248, 220, 0.8) 100%);
}

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

button {
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 25%, #cd853f 50%, #daa520 75%, #ffc107 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 800;
    font-family: 'Fredoka One', cursive;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 25px rgba(139, 69, 19, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 15px 40px rgba(139, 69, 19, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

button:active {
    transform: translateY(-2px) scale(0.98);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.2);
}

.secondary-btn {
    background: linear-gradient(135deg, #654321 0%, #8b4513 25%, #a0522d 50%, #cd853f 100%);
    padding: 12px 24px;
    font-size: 14px;
}

.secondary-btn:hover {
    box-shadow: 
        0 10px 25px rgba(101, 67, 33, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.danger-btn {
    background: linear-gradient(135deg, #8b0000 0%, #dc143c 25%, #ff4500 50%, #ff6347 100%);
    padding: 10px 20px;
    font-size: 12px;
    font-family: 'Nunito', sans-serif;
}

.danger-btn:hover {
    box-shadow: 
        0 8px 20px rgba(139, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.brews-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 248, 220, 0.9) 100%);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 
        0 15px 35px rgba(139, 69, 19, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(205, 133, 63, 0.3);
    backdrop-filter: blur(5px);
    position: relative;
}

.brews-section::before {
    content: '';
}

.brews-section h2 {
    color: #8b4513;
    margin-bottom: 25px;
    font-size: 1.6em;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    font-family: 'Fredoka One', cursive;
}

.brew-card, .recipe-card {
    border-radius: 18px;
    padding: 25px;
    margin-bottom: 25px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 25px rgba(139, 69, 19, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Default styling for cards (fallback) */
.brew-card:not(.beer-brew):not(.wine-brew),
.recipe-card:not(.beer-recipe):not(.wine-recipe) {
    background: linear-gradient(135deg, rgba(255, 248, 220, 0.95) 0%, rgba(245, 222, 179, 0.9) 100%);
    border: 3px solid rgba(218, 165, 32, 0.4);
}

/* Beer styling - Amber/Golden with grain pattern */
.brew-card.beer-brew,
.recipe-card.beer-recipe {
    background: 
        radial-gradient(2px 2px at 20px 30px, rgba(218, 165, 32, 0.15), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 193, 7, 0.1), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(218, 165, 32, 0.12), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255, 193, 7, 0.08), transparent),
        linear-gradient(135deg, rgba(255, 248, 220, 0.95) 0%, rgba(245, 222, 179, 0.9) 100%);
    border: 3px solid rgba(218, 165, 32, 0.4);
}

.brew-card.beer-brew::before,
.recipe-card.beer-recipe::before {
    background: radial-gradient(circle, rgba(255, 193, 7, 0.08) 0%, transparent 70%);
}

.brew-card.beer-brew:hover,
.recipe-card.beer-recipe:hover {
    border-color: rgba(218, 165, 32, 0.6);
}

/* Wine styling - Deep Red/Purple with grape vine pattern */
.brew-card.wine-brew,
.recipe-card.wine-recipe {
    background: 
        radial-gradient(3px 3px at 25px 25px, rgba(147, 51, 102, 0.1), transparent),
        radial-gradient(2px 2px at 50px 60px, rgba(128, 0, 32, 0.08), transparent),
        radial-gradient(1px 1px at 80px 35px, rgba(147, 51, 102, 0.12), transparent),
        radial-gradient(2px 2px at 110px 75px, rgba(128, 0, 32, 0.06), transparent),
        linear-gradient(135deg, rgba(255, 240, 245, 0.95) 0%, rgba(240, 220, 235, 0.9) 100%);
    border: 3px solid rgba(147, 51, 102, 0.4);
}

.brew-card.wine-brew::before,
.recipe-card.wine-recipe::before {
    background: radial-gradient(circle, rgba(147, 51, 102, 0.08) 0%, transparent 70%);
}

.brew-card.wine-brew:hover,
.recipe-card.wine-recipe:hover {
    border-color: rgba(147, 51, 102, 0.6);
}

/* Type indicator badges */
.type-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    margin-left: 10px;
}

.type-indicator.beer {
    background: rgba(218, 165, 32, 0.2);
    color: #8b4513;
    border: 1px solid rgba(218, 165, 32, 0.3);
}

.type-indicator.wine {
    background: rgba(147, 51, 102, 0.2);
    color: #722d5c;
    border: 1px solid rgba(147, 51, 102, 0.3);
}

/* Filter controls */
.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-label {
    font-weight: 600;
    color: #8b4513;
    font-size: 0.9em;
    min-width: 50px;
}

#year-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-button {
    padding: 8px 16px;
    border: 2px solid rgba(218, 165, 32, 0.3);
    background: rgba(255, 248, 220, 0.8);
    color: #8b4513;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.filter-button:hover {
    background: rgba(218, 165, 32, 0.2);
    border-color: rgba(218, 165, 32, 0.5);
}

.filter-button.active {
    background: rgba(218, 165, 32, 0.3);
    border-color: rgba(218, 165, 32, 0.6);
    color: #5c2e0a;
}

.filter-button.wine {
    border-color: rgba(147, 51, 102, 0.3);
    background: rgba(255, 240, 245, 0.8);
    color: #722d5c;
}

.filter-button.wine:hover {
    background: rgba(147, 51, 102, 0.2);
    border-color: rgba(147, 51, 102, 0.5);
}

.filter-button.wine.active {
    background: rgba(147, 51, 102, 0.3);
    border-color: rgba(147, 51, 102, 0.6);
}

/* Section headers */
.section-header {
    font-size: 1.4em;
    font-weight: 800;
    margin: 30px 0 20px 0;
    color: #8b4513;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    font-family: 'Fredoka One', cursive;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header.wine {
    color: #722d5c;
}

/* Animated tagline styles */
.animated-tagline {
    font-size: 1.2em;
    color: rgba(255, 248, 220, 0.9);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    margin-top: 10px;
}

.word-container {
    position: relative;
    display: inline-block;
    height: 1.4em;
    width: 4em;
    overflow: visible;
    vertical-align: baseline;
}

.animated-word {
    position: absolute;
    top: 0.4em;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.2;
}

.animated-word.active {
    opacity: 1;
    transform: translateY(0);
}

.animated-word.exiting {
    opacity: 0;
    transform: translateY(-15px);
}

/* Color transitions for specific words */
.animated-word[data-word="beer"] {
    color: #ffc107;
    text-shadow: 1px 1px 2px rgba(139, 69, 19, 0.5);
}

.animated-word[data-word="wine"] {
    color: #dc3545;
    text-shadow: 1px 1px 2px rgba(114, 45, 92, 0.5);
}

.animated-word[data-word="grain"] {
    color: #ffc107;
    text-shadow: 1px 1px 2px rgba(139, 69, 19, 0.5);
}

.animated-word[data-word="grape"] {
    color: #dc3545;
    text-shadow: 1px 1px 2px rgba(114, 45, 92, 0.5);
}

.brew-card::before, .recipe-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.1) 0%, transparent 70%);
    transform: rotate(45deg);
    pointer-events: none;
}

.brew-card:hover, .recipe-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(139, 69, 19, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(218, 165, 32, 0.6);
}

.brew-header, .recipe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    position: relative;
    z-index: 1;
}

.brew-name, .recipe-name {
    font-size: 1.5em;
    font-weight: 800;
    color: #8b4513;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.5);
    font-family: 'Fredoka One', cursive;
}

.brew-type {
    color: #cd853f;
    font-size: 1em;
    margin-top: 5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.brew-recipe {
    margin-top: 8px;
    font-size: 0.9em;
}

.recipe-label {
    color: #8b4513;
    font-weight: 600;
}

.recipe-link {
    color: #2563eb;
    cursor: pointer;
    text-decoration: underline;
    font-weight: 700;
    transition: color 0.3s ease;
}

.recipe-link:hover {
    color: #1d4ed8;
    text-decoration: none;
}

/* Recipe brews styling */
.recipe-brews {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
}

.recipe-brews h4 {
    color: #8b4513;
    margin-bottom: 10px;
    font-family: 'Fredoka One', cursive;
}

.recipe-brew-item {
    cursor: pointer;
    padding: 8px;
    margin: 5px 0;
    background: rgba(255,255,255,0.5);
    border-radius: 6px;
    border-left: 4px solid #2563eb;
    transition: all 0.3s ease;
}

.recipe-brew-item:hover {
    background: rgba(255,255,255,0.8);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.recipe-brew-item .brew-status {
    font-size: 0.8em;
    padding: 4px 8px;
}

.brew-actions, .recipe-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.brew-status {
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 0.85em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Nunito', sans-serif;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.status-fermenting {
    background: linear-gradient(135deg, #ff8c00 0%, #ffa500 50%, #ffb347 100%);
    color: #8b4513;
    border: 2px solid rgba(139, 69, 19, 0.3);
}

.status-complete {
    background: linear-gradient(135deg, #228b22 0%, #32cd32 50%, #90ee90 100%);
    color: #006400;
    border: 2px solid rgba(0, 100, 0, 0.3);
}

.brew-details, .recipe-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.detail-item {
    background: rgba(255, 255, 255, 0.7);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.detail-label {
    font-size: 0.8em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

.readings-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.reading-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
    margin-bottom: 15px;
}

.readings-list {
    max-height: 200px;
    overflow-y: auto;
}

.reading-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    margin-bottom: 8px;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    background: rgba(139, 69, 19, 0.1);
    border-radius: 15px;
    padding: 8px;
}

.tab-button {
    flex: 1;
    background: transparent;
    border: none;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #8b4513;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Fredoka One', cursive;
}

.tab-button.active {
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 25%, #cd853f 50%, #daa520 75%, #ffc107 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.ingredients-section {
    margin: 25px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 15px;
    border: 2px solid rgba(218, 165, 32, 0.3);
}

.ingredients-section h3 {
    color: #8b4513;
    margin-bottom: 15px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.3em;
}

.ingredient-row {
    display: grid;
    grid-template-columns: 120px 1fr 100px 80px 150px 100px;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.ingredient-row select,
.ingredient-row input {
    padding: 8px 12px;
    border: 2px solid rgba(218, 165, 32, 0.3);
    border-radius: 8px;
    font-size: 16px;
}

.ingredient-row .danger-btn {
    padding: 8px 12px;
    font-size: 13px;
    min-width: 80px;
    white-space: nowrap;
    font-weight: 600;
}

.recipe-ingredients {
    background: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.ingredients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.ingredient-group h4 {
    color: #8b4513;
    font-size: 1.1em;
    margin-bottom: 8px;
    font-weight: 700;
}

.ingredient-item {
    padding: 4px 0;
    font-size: 0.9em;
    color: #654321;
}

.loading {
    text-align: center;
    color: #666;
    padding: 40px;
    font-style: italic;
}

.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    border: 2px solid #f1b0b7;
    font-weight: 600;
}

.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    border: 2px solid #b8dacc;
    font-weight: 600;
}

.no-data {
    text-align: center;
    color: #8b4513;
    font-style: italic;
    padding: 40px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .container {
        margin: 5px;
        border-radius: 15px;
    }
    
    .content {
        padding: 12px;
    }
    
    .header {
        padding: 20px 12px;
    }
    
    .header h1 {
        font-size: 2.2em;
        text-align: center;
    }
    
    .header p {
        font-size: 1.1em;
        text-align: center;
    }
    
    .form-section {
        padding: 15px 12px;
        margin-bottom: 15px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-group label {
        font-size: 1em;
        margin-bottom: 8px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Ensure ingredient inputs don't cause zoom on tablets */
    .ingredient-row select,
    .ingredient-row input {
        font-size: 16px;
        padding: 10px 12px;
    }
    
    .tabs {
        flex-wrap: wrap;
        gap: 10px;
        padding: 0 10px;
        justify-content: center;
    }
    
    .tab-button {
        padding: 12px 20px;
        font-size: 1em;
        min-width: 120px;
        flex: 1;
        max-width: 200px;
        margin-bottom: 0;
    }
    
    .brew-header, .recipe-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .brew-actions, .recipe-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .brew-status {
        order: -1;
        text-align: center;
        margin-bottom: 8px;
    }
    
    .admin-actions {
        display: flex;
        gap: 8px;
        justify-content: center;
    }
    
    .admin-actions button {
        flex: 1;
        max-width: 80px;
        font-size: 0.8em;
        padding: 6px 8px;
    }
    
    /* For recipes with 3 buttons, make them smaller */
    .recipe-actions .admin-actions button {
        max-width: 60px;
        font-size: 0.75em;
        padding: 5px 6px;
    }
    
    .brew-details, .recipe-stats {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .detail-item {
        text-align: center;
    }
    
    .reading-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .reading-form .form-group {
        margin-bottom: 0;
    }

    .ingredient-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .ingredient-row button {
        grid-column: 1 / -1;
        margin-top: 10px;
        min-width: 120px;
    }

    .ingredients-grid {
        grid-template-columns: 1fr;
    }
    
    .brew-images {
        gap: 8px;
        justify-content: center;
    }
    
    .brew-image {
        width: 100px;
        height: 75px;
    }
    
    .image-preview {
        max-width: 150px;
    }
    
    .brews-section, .active-brews-section {
        padding: 15px 12px;
    }
    
    /* Better button sizing for touch interfaces */
    button {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Improve form input spacing */
    .form-group {
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 2px;
        border-radius: 12px;
    }
    
    .content {
        padding: 8px;
    }
    
    .header {
        padding: 15px 8px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .header p {
        font-size: 1em;
    }
    
    .form-section, .brews-section, .active-brews-section {
        padding: 12px 8px;
    }
    
    .tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .tab-button {
        width: 100%;
        max-width: none;
        padding: 14px;
        font-size: 1.1em;
    }
    
    .brew-details, .recipe-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .detail-item {
        padding: 10px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 8px;
        text-align: left;
    }
    
    .detail-label {
        font-size: 0.9em;
        margin-bottom: 4px;
    }
    
    .detail-value {
        font-size: 1.1em;
    }
    
    .brew-images {
        justify-content: flex-start;
        gap: 6px;
    }
    
    .brew-image {
        width: 80px;
        height: 60px;
    }
    
    .reading-form {
        gap: 12px;
    }
    
    .reading-form input,
    .reading-form button {
        width: 100%;
    }
    
    .ingredient-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .ingredient-row select,
    .ingredient-row input {
        width: 100%;
    }
    
    /* Larger touch targets for very small screens */
    button {
        min-height: 48px;
        font-size: 1em;
    }
    
    .danger-btn {
        padding: 10px 16px;
        min-width: 100px;
    }
    
    .ingredient-row .danger-btn {
        min-width: 120px;
        padding: 12px 16px;
    }
    
    .secondary-btn {
        padding: 10px 16px;
    }
    
    /* Improve form field sizing */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 14px;
        font-size: 16px;
    }
    
    /* Ensure ingredient inputs don't cause zoom */
    .ingredient-row select,
    .ingredient-row input {
        font-size: 16px;
        padding: 12px;
    }
    
    /* Better message display on mobile */
    #message {
        margin: 15px 10px;
        padding: 12px;
        font-size: 0.95em;
    }
}

/* Image Upload Styles */
.image-upload {
    display: block;
    width: 100%;
    padding: 10px;
    border: 2px dashed #8b4513;
    border-radius: 8px;
    background: rgba(255, 248, 220, 0.1);
    color: #fff;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.image-upload:hover {
    border-color: #ffc107;
    background: rgba(255, 248, 220, 0.2);
}

.image-upload:focus {
    outline: none;
    border-color: #ffc107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.3);
}

.image-preview {
    margin-top: 15px;
    position: relative;
    display: inline-block;
    max-width: 200px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(220, 20, 60, 0.8);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.remove-image:hover {
    background: rgba(220, 20, 60, 1);
}

/* Brew Image Display */
.brew-images {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.brew-image {
    position: relative;
    width: 120px;
    height: 90px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

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

.brew-image:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

.delete-image-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.delete-image-btn:hover {
    background: rgba(255, 0, 0, 1);
}

/* Mobile-specific improvements */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch devices */
    .brew-image:hover,
    button:hover,
    .tab-button:hover,
    .form-group input:hover,
    .form-group select:hover,
    .form-group textarea:hover {
        transform: none;
        background-color: inherit;
    }
    
    /* Add better touch feedback */
    button:active,
    .tab-button:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    .brew-image:active {
        opacity: 0.8;
        transition: opacity 0.1s ease;
    }
}

/* Ensure proper scrolling on mobile */
body {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Better focus indicators for accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #ffc107;
    outline-offset: 2px;
}

/* Prevent text selection on interactive elements */
button,
.tab-button,
.brew-image {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Modal error message styles */
.modal-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #d32f2f;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
    animation: modalErrorSlideIn 0.3s ease-out;
}

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

/* Admin Authentication Styles */
.admin-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.admin-btn {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 50%, #1a202c 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(26, 32, 44, 0.3);
    min-height: auto;
}

.admin-btn:hover {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 50%, #000 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 32, 44, 0.4);
}

.admin-btn.logged-in {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 50%, #276749 100%);
}

.admin-btn.logged-in:hover {
    background: linear-gradient(135deg, #2f855a 0%, #276749 50%, #22543d 100%);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, rgba(255, 248, 220, 0.98) 0%, rgba(245, 222, 179, 0.98) 100%);
    border-radius: 20px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 193, 7, 0.3);
    animation: modalFadeIn 0.3s ease-out;
    position: relative;
    z-index: 1;
}

/* Wider modals for desktop */
@media (min-width: 768px) {
    .modal-content {
        max-width: 600px;
    }
    
    #editRecipeModal .modal-content {
        max-width: 900px;
    }
    
    #editBrewModal .modal-content {
        max-width: 700px;
    }
}

@media (min-width: 1200px) {
    #editRecipeModal .modal-content {
        max-width: 1000px;
    }
    
    #editBrewModal .modal-content {
        max-width: 800px;
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px 15px 30px;
    border-bottom: 2px solid rgba(139, 69, 19, 0.1);
}

.modal-header h2 {
    color: #8b4513;
    margin: 0;
    font-size: 1.4em;
    font-family: 'Fredoka One', cursive;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #8b4513;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    min-height: auto;
}

.close-btn:hover {
    background: rgba(139, 69, 19, 0.1);
}

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

.modal-body p {
    color: #8b4513;
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: flex-end;
}

.admin-login-btn {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 50%, #276749 100%);
    padding: 12px 24px;
    font-size: 14px;
}

.admin-login-btn:hover {
    background: linear-gradient(135deg, #2f855a 0%, #276749 50%, #22543d 100%);
    box-shadow: 0 8px 20px rgba(56, 161, 105, 0.4);
}

/* Admin-only content visibility */
.admin-only {
    display: none;
}

.admin-logged-in .admin-only {
    display: block;
}

.admin-actions {
    display: none;
}

.admin-logged-in .admin-actions {
    display: flex;
}

/* Read-only mode styling */
.read-only-notice {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    color: #2d3748;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid #a0aec0;
    font-weight: 600;
    text-align: center;
}

/* Active brews section */
.active-brews-section {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 138, 76, 0.1) 100%);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid rgba(255, 193, 7, 0.3);
    position: relative;
    overflow: hidden;
}

.active-brews-section::before {
    content: '🔥';
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    opacity: 0.5;
}

.active-brews-section h2 {
    color: #8b4513;
    margin-bottom: 20px;
    font-size: 1.6em;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    font-family: 'Fredoka One', cursive;
}

/* Mobile overrides for active brews section */
@media (max-width: 768px) {
    .active-brews-section {
        padding: 15px 12px;
    }
}

@media (max-width: 480px) {
    .active-brews-section {
        padding: 12px 8px;
    }
}

@media (max-width: 768px) {
    .admin-controls {
        position: static;
        text-align: center;
        margin: 15px 0 10px 0;
        order: 1;
    }
    
    .header {
        display: flex;
        flex-direction: column;
        position: relative;
    }
    
    .admin-btn {
        padding: 8px 12px;
        font-size: 11px;
        margin: 0 auto;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header,
    .modal-body {
        padding: 20px;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .admin-login-btn,
    .modal-actions .secondary-btn {
        width: 100%;
        text-align: center;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 193, 7, 0.3);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 193, 7, 0.2);
    border-top: 4px solid #ffc107;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

.loading-text {
    color: #333;
    font-weight: 600;
    font-size: 16px;
}

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

/* Cache busting update: Sat Aug 30 23:38:18 EDT 2025 */
