body {
    margin: 0;
    font-family: 'Raleway', Arial, sans-serif;
    background-color: #178fd0;
    color: white;
}

button, input, select, textarea {
    font-family: 'Raleway', Arial, sans-serif;
}


/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0.15);
}

.logo img {
    height: 40px;
}

.account .login-link {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

/* Buttons */
.button-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.main-btn {
    background-color: white;
    color: #178fd0;
    border: none;
    padding: 10px 15px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.2s;
}

.main-btn:hover {
    background-color: #f0f0f0;
}

/* Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    inset: 0; /* shorthand for top, right, bottom, left = 0 */
    background-color: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}


.modal-content {
    background-color: white;
    color: #333;
    margin: 8% auto;
    padding: 25px 20px;
    border-radius: 12px;
    width: 320px;
    box-shadow: 0px 8px 24px rgba(0,0,0,0.3);
    position: relative;
    animation: slideDown 0.3s ease;
}

.modal-content h2 {
    margin-top: 0;
    text-align: center;
    color: #178fd0;
    font-weight: bold;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-content input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
}

.modal-content input:focus {
    border-color: #178fd0;
    outline: none;
    box-shadow: 0 0 4px rgba(23, 143, 208, 0.5);
}

.modal-content button {
    background-color: #178fd0;
    color: white;
    border: none;
    padding: 10px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.modal-content button:hover {
    background-color: #0f6ea5;
}

.modal-content p {
    text-align: center;
    font-size: 0.9rem;
}

.modal-content p a {
    color: #178fd0;
    text-decoration: none;
    font-weight: bold;
}

.modal-content p a:hover {
    text-decoration: underline;
}

.close {
    position: absolute;
    right: 15px;
    top: 12px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: #333;
}

/* Animations */
@keyframes fadeIn {
    from { background-color: rgba(0,0,0,0); }
    to { background-color: rgba(0,0,0,0.6); }
}

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

.account-dropdown {
    position: relative;
    cursor: pointer;
    font-weight: bold;
    border-radius: 6px; /* Add this */
    overflow: visible;  /* Ensure dropdown can overflow */
}
/*
.account-dropdown:hover .dropdown-content {
    display: block;
    position: absolute;
    background: white;
    color: #178fd0;
    right: 0;
    top: 100%;
    min-width: 120px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
*/

/* new stuff for test */
.account-dropdown .dropdown-content {
    display: none;
    position: absolute;
    background: white;
    color: #178fd0;
    right: 0;
    top: 100%;
    min-width: 120px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.account-dropdown.open .dropdown-content {
    display: block;
}
/* end new stuff for test */


.dropdown-content a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #178fd0;
}

.dropdown-content a:hover {
    background-color: #e0f0ff;
    border-radius: 6px;
}

.ingredient-row input, .ingredient-row select {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: 'Raleway', sans-serif;
}

#addIngredientBtn:hover {
  background-color: #0f6ea5;
}

/* Helpers */
.hidden { 
    opacity: 0; 
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: none;
}

/* Card container */
.card {
  background: #fff;
  color: #178fd0;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  max-width: 600px;
  margin: 0 auto 30px;
  font-family: 'Raleway', Arial, sans-serif;
}
.card-title {
  margin: 0 0 12px 0;
  font-weight: 700;
}

/* Form */
.form { display: block; }
.form-group { margin-bottom: 16px; }
.label { display: block; font-weight: 700; margin-bottom: 6px; }

.input, .textarea, .select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: 'Raleway', Arial, sans-serif;
  font-size: 0.95rem;
  color: #333;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: #178fd0;
  outline: none;
  box-shadow: 0 0 4px rgba(23,143,208,0.4);
}

.fieldset { border: none; margin: 0 0 16px 0; padding: 0; }
.legend { font-weight: 700; margin-bottom: 8px; }

/* Ingredients UI */
.ingredients-container { display: flex; flex-direction: column; gap: 10px; }

.ingredient-row { display: flex; gap: 10px; align-items: center; }
.ingredient-row .amount { flex: 0 0 80px; }
.ingredient-row .unit { flex: 0 0 110px; }
.ingredient-row .name { flex: 1; }
.ingredient-row .base-spirit { display: flex; align-items: center; gap: 6px; }
.ingredient-row .remove {
  background: transparent;
  color: #178fd0;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

/* Buttons */
.btn-sm { padding: 8px 12px; font-size: 0.95rem; }

/* Messages */
.form-message { margin-top: 10px; font-weight: 700; }

#addCocktailForm input[type="text"],
#addCocktailForm select,
#addCocktailForm textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    margin: 4px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Preparation steps */
.prep-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.prep-row { display: flex; gap: 8px; align-items: center; }
.prep-input { flex: 1; }
.remove-prep {
  background-color: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
}
.remove-prep:hover { opacity: 0.9; }

.results-container {
    display: flex;
    align-items: stretch;
    gap: 20px;
    margin-top: 15px;
}
.results-container:not(.show-detail) {
    justify-content: center;
}
.results-container:not(.show-detail) .results-list {
  max-width: 500px;
  width: min(90vw, 500px);
}

/* Animated pieces */
.results-list,
.recipe-detail {
    transition: all 500ms ease;
    will-change: transform, width, opacity, flex-basis;
}

/* Results List */
.results-list {
    background: #ffffff00;
    color: #ffffff;
    /*border-radius: 0px;*/
    padding: 10px;
    /*box-shadow: 0 6px 18px rgba(0,0,0,0.15);*/
    gap: 12px;
    max-height: 400px;       /* adjust as needed */
    overflow-y: auto;
    overflow-x: hidden; /* disable native scrollbar */
    /*scrollbar-width: thin;            /* For Firefox */
    /*scrollbar-color: white transparent;*/
    /*clip-path: inset(0 round 10px); /* ensures contents + scrollbar clip to radius */
}

.results-list::-webkit-scrollbar {
    width: 10px;                      
    background-color: transparent;
}
/*
.results-list::-webkit-scrollbar-track {
    background-color: transparent;          
}
*/
.results-list::-webkit-scrollbar-thumb {
    background: white;          /* White thumb */
    border-radius: 6px;               /* Rounded edges */
    border: 2px solid transparent;    /* Space around thumb */
    background-clip: padding-box;     /* Ensures border doesn't affect size */
}

.results-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.8);
}

.result-item {
  font-size: 1.25rem;
  font-weight: 700;
  background: #ffffff00;
  border-radius: 8px;
  padding: 12px 16px;
  transition: background 0.5s ease, transform 0.2s ease, font-size 0.2s ease;
  transform-origin: left center;;
  cursor: pointer;
}

.result-item:hover {
    transform: scale(1.2);
}

#resultsSentinel { height: 1px; }

/* Right column: detail view */

.recipe-detail {
    background: transparent;
    color: #178fd0;
    border-radius: 10px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
    clip-path: inset(0 round 10px);
    opacity: 0;
    transform: translateX(10px) scale(0.98);
    pointer-events: none;
    flex: 0 0 0;
    max-width: 0; 
    /* new stuff */
    position: relative;
    padding-top: 44px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

/* When showing detail: slide results left, grow detail in */
.results-container.show-detail .results-list {
  flex: 0 0 35%;
  transform: translateX(0);
  max-width: 30%;
  padding-left: 20px;
}

.results-container.show-detail .recipe-detail {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
  flex: 1 1 auto;
  max-width: 50%;
  height: 400px;
}

/* TAB + HEADER (purely visual; doesn’t affect the hidden/visible state) */
.recipe-tab {
  position: absolute;
  top: 0px;
  left: 16px;
  background: #fff;
  color: #178fd0;
  border-radius: 12px 12px 0 0;
  padding: 10px 14px;
  /*box-shadow: 0 6px 18px rgba(0,0,0,0.15);*/
  display: flex;
  align-items: center;
  /*gap: 10px;*/
  max-width: calc(100% - 32px);
  height: 24px;
}

.recipe-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.25rem; /* adjust as you like */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recipe-body { 
    background: #fff;
    color: #178fd0;
    padding: 10px;
    margin-left: 1px;
    border-radius: 0 12px 12px 12px;
}

/* testing diabling this for new tab
/* Close button in detail 
.detail-close {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #178fd0;
  float: right;
  margin: -6px -2px 8px 8px;
} */

.recipe-tab .detail-close {
  appearance: none;
  border: none;
  background: #178fd0;
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  line-height: 1;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  margin-left: 10px;
  transition: opacity .15s ease;
}
.recipe-tab .detail-close:hover { opacity: 0.9; }

/* Optional inner sections */
.recipe-section + .recipe-section { margin-top: 14px; }
.recipe-section h4 { margin: 0 0 6px; font-size: 0.95rem; color: #178fd0; }
.recipe-section ul { margin: 0; padding-left: 18px; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .results-list, .recipe-detail { transition: none; }
}