/* CoffeeTune Complete Stylesheet - No Tailwind Required */

:root{
  --cream:#f7f3ee;
  --beige:#e9dfd3;
  --brown:#4b2e2b;
  --dark:#1f1b18;
  --accent:#b36b2b;
  --muted:#6b5b4a;
}

/* Reset & Base */
*{box-sizing:border-box; margin:0; padding:0;}

body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(180deg,var(--cream) 0%, #f6f4f1 40%, #efe8e2 100%);
  color:var(--dark);
  -webkit-font-smoothing:antialiased;
  line-height: 1.5;
}

/* Container */
.container{
  max-width:1100px;
  margin:32px auto;
  padding:28px;
}

@media (max-width:800px){ 
  .container{ 
    padding:12px; 
    margin: 16px auto;
  } 
}

/* Typography */
h1,h2,h3{ 
  color:var(--dark); 
  margin:0 0 12px 0;
  font-weight: 700;
}
h1{ font-size:28px; }
h2{ font-size:20px; color:var(--brown); }
h3{ font-size:18px; }

@media (max-width:800px){ 
  h1{ font-size:22px; }
  h2{ font-size:18px; }
  h3{ font-size:16px; }
}

p { margin: 8px 0; }

/* Header */
header {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header .flex {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 768px) {
  header {
    padding: 16px;
  }
  header .flex {
    gap: 8px;
  }
}

/* Cards */
.card{
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.8));
  border-radius:12px;
  padding:16px;
  box-shadow:0 8px 24px rgba(11,9,8,0.06);
  margin-bottom: 12px;
}

.bean-card, .brew-card, .machine-card {
  background: white;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s;
}

.bean-card:hover, .brew-card:hover, .machine-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--brown);
}

.card-detail {
  font-size: 14px;
  color: #666;
  margin: 4px 0;
}

.card-detail strong {
  color: var(--dark);
}

/* Form Sections */
.form-section {
  background: white;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 12px;
}

/* Form Elements */
label{ 
  display:block; 
  margin-bottom:8px; 
  color:var(--muted); 
  font-weight:600;
  font-size: 15px;
}

@media (max-width: 767px) {
  label {
    font-size: 14px;
  }
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea{
  width:100%; 
  padding:12px 14px; 
  border-radius:10px; 
  border:1px solid rgba(0,0,0,0.06); 
  background:#fff; 
  color:var(--dark); 
  font-size:16px !important; /* Prevents iOS zoom */
  margin-bottom:12px; 
  outline:none;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus{ 
  box-shadow:0 0 0 4px rgba(179,107,43,0.07);
  border-color: rgba(179,107,43,0.3);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* Buttons */
button{
  background:var(--accent); 
  color:white; 
  border:none; 
  padding:12px 18px; 
  border-radius:10px; 
  cursor:pointer; 
  font-weight:700; 
  box-shadow:0 6px 20px rgba(179,107,43,0.12);
  font-size: 15px;
  transition: all 0.2s;
  font-family: inherit;
}

button:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button.secondary{ 
  background:transparent; 
  color:var(--muted); 
  border:1px solid rgba(0,0,0,0.06); 
  box-shadow:none;
}

button.secondary:hover {
  background: rgba(0,0,0,0.02);
  border-color: rgba(0,0,0,0.12);
}

button:disabled{ 
  opacity:.6; 
  cursor:not-allowed;
}

@media (max-width: 767px) {
  button {
    width: 100%;
    margin: 8px 0;
  }
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.action-buttons button {
  flex: 1;
  min-width: 100px;
  font-size: 14px;
  padding: 8px 12px;
}

@media (max-width: 767px) {
  .action-buttons button {
    width: 100%;
    flex: none;
  }
}

/* Links */
a{ 
  color:var(--accent); 
  text-decoration:none;
  transition: color 0.2s;
}

a:hover{ 
  text-decoration:underline;
  color: #8a5420;
}

/* Tables */
table{ 
  width:100%; 
  border-collapse:collapse; 
  margin-top:8px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

th,td{ 
  padding:12px 10px; 
  text-align:left; 
  color:var(--dark);
}

th{ 
  background:var(--beige); 
  color:var(--brown); 
  font-weight:700; 
  border-bottom:2px solid rgba(0,0,0,0.04);
}

tr:hover{ 
  background:rgba(0,0,0,0.01);
}

tbody tr {
  border-bottom: 1px solid rgba(0,0,0,0.03);
}

/* Responsive table handling */
@media (min-width: 768px) {
  .mobile-card-view {
    display: none;
  }
  .desktop-table-view {
    display: block;
  }
}

@media (max-width: 767px) {
  .mobile-card-view {
    display: block;
  }
  .desktop-table-view {
    display: none;
  }
}

/* Modals */
.modal{ 
  display:none; 
  position:fixed; 
  left:0; 
  top:0; 
  width:100%; 
  height:100%; 
  background:rgba(0,0,0,0.45); 
  z-index:1000;
  overflow-y: auto;
  padding: 20px 0;
}

.modal-content{ 
  background:#fff; 
  margin:12% auto; 
  padding:20px; 
  border-radius:10px; 
  width:90%; 
  max-width:900px;
  position: relative;
  z-index: 1001;
}

@media (max-width: 767px) {
  .modal-content {
    margin: 20px auto;
    padding: 16px;
    width: 90%;
  }
  
  .modal-content h2 {
    font-size: 18px;
  }
}

/* Searchable Select */
.searchable-select { 
  width:100%; 
  position:relative; 
}

.searchable-select input { 
  width:100%; 
  box-sizing:border-box;
}

.searchable-select ul { 
  list-style:none; 
  margin:0; 
  padding:0; 
  max-height:200px; 
  overflow-y:auto; 
  background:#fff; 
  border:1px solid #ccc; 
  position:absolute; 
  width:100%; 
  z-index:2;
  border-radius: 8px;
  margin-top: 4px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.searchable-select li { 
  padding:12px; 
  cursor:pointer;
  border-bottom: 1px solid #f0f0f0;
}

.searchable-select li:last-child {
  border-bottom: none;
}

.searchable-select li:hover { 
  background:#f0f0f0; 
}

/* Custom Dropdown */
.custom-dropdown:focus-within .dropdown-menu { 
  display: block !important; 
}

.dropdown-selected { 
  padding:12px;
  border:1px solid #ccc;
  border-radius:8px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:48px;
  background:#fff;
  font-size: 16px;
}

.dropdown-selected:hover, 
.dropdown-selected:focus { 
  border-color: #2563eb; 
}

.dropdown-menu { 
  display:none;
  position:absolute;
  left:0;
  top:110%;
  width:100%;
  background:#fff;
  border:1px solid #ccc;
  border-radius:8px;
  box-shadow:0 2px 8px rgba(0,0,0,0.08);
  z-index:20;
  max-height: 300px;
  overflow-y: auto;
}

.dropdown-menu button.option-btn { 
  width:100%;
  text-align:left;
  padding:12px;
  border:none;
  background:none;
  cursor:pointer;
  transition:background 0.15s;
  font-size: 16px;
}

.dropdown-menu button.option-btn:hover, 
.dropdown-menu button.option-btn.selected { 
  background:#f0f4ff; 
}

.dropdown-menu .no-options { 
  color:#888;
  padding:12px;
}

/* Icons */
.icon{ 
  margin-right:8px;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }

.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }

.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }

.rounded { border-radius: 4px; }
.rounded-md { border-radius: 6px; }
.rounded-lg { border-radius: 8px; }

.border { border: 1px solid rgba(0,0,0,0.1); }

.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-base { font-size: 16px; }
.text-lg { font-size: 18px; }

.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }

.max-w-6xl { max-width: 1280px; }
.mx-auto { margin-left: auto; margin-right: auto; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* Responsive utilities */
@media (max-width: 767px) {
  .md\:hidden {
    display: none !important;
  }
  
  .md\:p-6 {
    padding: 16px;
  }
  
  .md\:text-lg {
    font-size: 16px;
  }
  
  .md\:text-sm {
    font-size: 12px;
  }
}

@media (min-width: 768px) {
  .hidden.md\:block {
    display: block !important;
  }
  
  .hidden.md\:flex {
    display: flex !important;
  }
}

/* Footer */
footer{ 
  text-align:center; 
  margin-top:32px; 
  color:var(--muted); 
  padding:18px;
}

/* Animations */
.fade{ 
  opacity:0; 
  transform:translateY(8px); 
  transition:opacity .48s, transform .48s;
}

.fade.in{ 
  opacity:1; 
  transform:none;
}

/* Loading States */
.loading {
  color: #888;
  font-style: italic;
}

/* Small note text */
.small-note {
  font-size: 13px;
  color: var(--muted);
}
.responsive-img {
    width: 100%;
    aspect-ratio: 4 / 3; /* keeps a stable shape on all screens */
    overflow: hidden;
    border-radius: 8px;
}

.responsive-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}

/* Optional: adjust for taller visuals on mobile */
@media (max-width: 640px) {
    .responsive-img {
        aspect-ratio: 1 / 1; /* more vertical space on phones */
    }
}
