body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #0f1419 100%);
}

.recipe-card {
    transition: all 0.3s ease;
}

.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

#tabs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #9ca3af;
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.tab-button:hover {
    background-color: #374151;
    color: #ffffff;
}

.tab-button.active {
    color: #ffffff;
    background-color: #be123c;
    border-color: #be123c;
}


/* --- Base Building: multi-stage structure cards --- */
.structure-card {
    position: relative;
}

.structure-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fca5a5;
    background-color: rgba(190, 18, 60, 0.18);
    border: 1px solid rgba(190, 18, 60, 0.5);
    border-radius: 9999px;
    padding: 0.15rem 0.6rem;
    margin-bottom: 0.5rem;
}

.totals-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    background-color: rgba(17, 24, 39, 0.6);
    border: 1px solid #374151;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
}

.totals-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f87171;
}

.totals-value {
    font-size: 0.8rem;
    color: #d1d5db;
}

.stage-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.25rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    background-color: #be123c;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.stage-toggle:hover {
    background-color: #9f1239;
}

.stage-toggle-caret {
    transition: transform 0.2s ease;
    font-size: 0.7rem;
}

.structure-card.open .stage-toggle-caret {
    transform: rotate(180deg);
}

.stage-list {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stage-list.stages-collapsed {
    display: none;
}

.stage-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: rgba(17, 24, 39, 0.5);
    border: 1px solid #374151;
    border-left: 3px solid #be123c;
    border-radius: 0.5rem;
}

.stage-badge {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    background-color: #be123c;
    border-radius: 9999px;
}

.stage-body {
    flex: 1;
    min-width: 0;
}

.stage-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.stage-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
}

.stage-note {
    font-size: 0.7rem;
    font-style: italic;
    color: #9ca3af;
}

.material-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.45rem;
}

.material-chip {
    font-size: 0.75rem;
    color: #e5e7eb;
    background-color: rgba(55, 65, 81, 0.7);
    border: 1px solid #4b5563;
    border-radius: 0.3rem;
    padding: 0.15rem 0.5rem;
    white-space: nowrap;
}

.stage-tool {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.stage-tool-icon {
    font-size: 0.8rem;
}

/* Light Mode Support */
[data-theme="light"] body {
    background: linear-gradient(135deg, #f0f5fa 0%, #e3e9f0 100%) !important;
    color: #1f2937 !important;
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3 {
    color: #1f2937 !important;
}

[data-theme="light"] .text-gray-400 {
    color: #6b7280 !important;
}

[data-theme="light"] .text-gray-300 {
    color: #4b5563 !important;
}

[data-theme="light"] .text-gray-200 {
    color: #1f2937 !important;
}

[data-theme="light"] .recipe-card {
    background-color: #ffffff !important;
    border-color: #d1d5db !important;
    color: #1f2937 !important;
}

[data-theme="light"] .recipe-card:hover {
    border-color: #2563eb !important;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2) !important;
}

[data-theme="light"] .text-white {
    color: #1f2937 !important;
}

[data-theme="light"] .text-red-400 {
    color: #2563eb !important;
}

[data-theme="light"] #search-input {
    background-color: #ffffff !important;
    border-color: #d1d5db !important;
    color: #1f2937 !important;
}

[data-theme="light"] #search-input::placeholder {
    color: #9ca3af !important;
}

[data-theme="light"] #search-input:focus {
    border-color: #2563eb !important;
    ring-color: #2563eb !important;
}

[data-theme="light"] #no-results h3 {
    color: #6b7280 !important;
}

[data-theme="light"] #no-results p {
    color: #9ca3af !important;
}

[data-theme="light"] .tab-button {
    background-color: #e5e7eb;
    color: #374151;
    border-color: #d1d5db;
}

[data-theme="light"] .tab-button:hover {
    background-color: #d1d5db;
}

[data-theme="light"] .tab-button.active {
    background-color: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* Light mode: structure / stage cards */
[data-theme="light"] .structure-badge {
    color: #1d4ed8;
    background-color: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.4);
}

[data-theme="light"] .totals-row {
    background-color: #f3f4f6 !important;
    border-color: #d1d5db !important;
}

[data-theme="light"] .totals-label {
    color: #2563eb !important;
}

[data-theme="light"] .totals-value {
    color: #374151 !important;
}

[data-theme="light"] .stage-toggle {
    background-color: #2563eb;
}

[data-theme="light"] .stage-toggle:hover {
    background-color: #1d4ed8;
}

[data-theme="light"] .stage-item {
    background-color: #f9fafb !important;
    border-color: #d1d5db !important;
    border-left-color: #2563eb !important;
}

[data-theme="light"] .stage-badge {
    background-color: #2563eb;
}

[data-theme="light"] .stage-name {
    color: #1f2937 !important;
}

[data-theme="light"] .stage-note {
    color: #6b7280 !important;
}

[data-theme="light"] .material-chip {
    color: #1f2937 !important;
    background-color: #e5e7eb !important;
    border-color: #d1d5db !important;
}

[data-theme="light"] .stage-tool {
    color: #6b7280 !important;
}
