/* POTM Tailoring Calculator Styles */
@import url('./book-theme.css');

:root {
    --primary-bg: #2c1810;
    --secondary-bg: #f4e8d8;
    --card-bg: #f9f3e8;
    --accent-color: #8b3a3a;
    --accent-silver: #8b6f47;
    --text-primary: #3a2817;
    --text-secondary: #6b5a47;
    --border-color: #b89968;
    --hover-border: #8b3a3a;
    --parchment: #f9f3e8;
    --ink: #2c1810;
    --primary-color: #2c1810;
    --secondary-color: #f4e8d8;
    --dark-bg: #e8dcc8;
    --text-light: #3a2817;
    --accent: #b8860b;
}

/* Dark Mode Theme */
body.dark-mode {
    --primary-bg: #0f0a08;
    --secondary-bg: #1a1410;
    --card-bg: #221a14;
    --accent-color: #d4937c;
    --accent-silver: #c9a76f;
    --text-primary: #e8dcc8;
    --text-secondary: #b89968;
    --border-color: #6b5535;
    --hover-border: #d4937c;
    --parchment: #2a2218;
    --ink: #e8dcc8;
    --primary-color: #0f0a08;
    --secondary-color: #1a1410;
    --dark-bg: #2a2218;
    --text-light: #e8dcc8;
    --accent: #e5b347;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Crimson Text', 'Garamond', 'Georgia', serif;
    background: linear-gradient(135deg, #2c1810 0%, #1a0f0a 100%);
    background-attachment: fixed;
    color: var(--text-light);
    min-height: 100vh;
    line-height: 1.8;
    font-size: 15px;
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    background: linear-gradient(135deg, #0a0605 0%, #000000 100%);
}

/* Enchanting Toggle Switch */
.enchant-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.enchant-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.enchant-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4a4a4a;
    transition: 0.3s;
    border-radius: 24px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.enchant-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.enchant-switch input:checked + .enchant-slider {
    background: linear-gradient(135deg, #8b3a3a 0%, #c41e3a 100%);
    box-shadow: 0 0 10px rgba(139, 58, 58, 0.5), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.enchant-switch input:checked + .enchant-slider:before {
    transform: translateX(26px);
    box-shadow: 0 2px 8px rgba(139, 58, 58, 0.4);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.03) 2px, rgba(0,0,0,.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,.03) 2px, rgba(0,0,0,.03) 4px);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #f4e8d8 0%, #e8dcc8 100%);
    padding: 60px 20px 40px;
    margin-bottom: 40px;
    border: 3px solid #8b6f47;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

body.dark-mode header {
    background: linear-gradient(135deg, #2a2218 0%, #1a1410 100%);
    border-color: var(--border-color);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

header h1 {
    font-size: 3rem;
    color: var(--ink);
    margin-bottom: 15px;
    font-family: 'Cinzel', 'Georgia', serif;
    font-weight: 700;
    letter-spacing: 3px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #8b6f47, #6b5535);
    border: 2px solid #5a4528;
    border-radius: 8px;
    color: #f4e8d8;
    font-family: 'Cinzel', 'Georgia', serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle:hover {
    background: linear-gradient(135deg, #6b5535, #5a4528);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

body.dark-mode .theme-toggle {
    background: linear-gradient(135deg, #3a2e24, #2a2218);
    border-color: #6b5535;
    color: #e8dcc8;
}

body.dark-mode .theme-toggle:hover {
    background: linear-gradient(135deg, #2a2218, #1a1410);
}

.theme-toggle-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.theme-toggle-text {
    font-size: 0.9rem;
}

/* Coffee Button */
.coffee-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    transition: all 0.3s ease;
    display: block;
}

.coffee-popup img {
    height: 50px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.coffee-popup:hover img {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 221, 0, 0.6);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-style: italic;
}

#backButton {
    margin-top: 20px;
    padding: 10px 25px;
    background: var(--accent);
    color: #000;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background 0.3s ease;
}

#backButton:hover {
    background: #d4a017;
}

.back-button {
    position: absolute;
    top: 2px;
    left: 20px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #e8dcc8 0%, #d4c4a8 100%);
    color: var(--ink);
    border: 2px solid #8b6f47;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cinzel', 'Georgia', serif;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .back-button {
    background: linear-gradient(135deg, #3a2e24 0%, #2a2218 100%);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.back-button:hover {
    background: linear-gradient(135deg, #8b3a3a 0%, #6b2a2a 100%);
    color: #f9f3e8;
    border-color: #6b2a2a;
    box-shadow: 0 4px 15px rgba(139, 58, 58, 0.5);
    transform: translateY(-2px);
}

body.dark-mode .back-button:hover {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--hover-border) 100%);
    border-color: var(--hover-border);
}

/* Show Table Button */
.show-table-btn {
    margin-top: 15px;
    margin-left: 10px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #e8dcc8 0%, #d4c4a8 100%);
    color: var(--ink);
    border: 2px solid #8b6f47;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-family: 'Cinzel', 'Georgia', serif;
}

body.dark-mode .show-table-btn {
    background: linear-gradient(135deg, #3a2e24 0%, #2a2218 100%);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.show-table-btn:hover {
    background: linear-gradient(135deg, #8b3a3a 0%, #6b2a2a 100%);
    color: #f9f3e8;
    border-color: #6b2a2a;
    box-shadow: 0 4px 15px rgba(139, 58, 58, 0.5);
    transform: translateY(-2px);
}

body.dark-mode .show-table-btn:hover {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--hover-border) 100%);
    border-color: var(--hover-border);
}

/* Calculator Navigation Bar */
.calc-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--parchment) 100%);
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    flex-wrap: wrap;
    transition: all 0.3s ease;
}

body.dark-mode .calc-nav {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--parchment) 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.calc-nav .nav-link {
    padding: 12px 24px;
    background: linear-gradient(135deg, #e8dcc8 0%, #d4c4a8 100%);
    border: 2px solid var(--border-color);
    color: var(--ink);
    text-decoration: none;
    font-family: 'Cinzel', 'Georgia', serif;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.calc-nav .nav-icon {
    height: 1.5rem;
    width: auto;
    filter: sepia(0.3) brightness(0.8);
    transition: filter 0.3s ease;
}

body.dark-mode .calc-nav .nav-link {
    background: linear-gradient(135deg, #3a2e24 0%, #2a2218 100%);
    color: var(--text-primary);
}

body.dark-mode .calc-nav .nav-icon {
    filter: brightness(1.2) sepia(0.2);
}

.calc-nav .nav-link:hover {
    background: linear-gradient(135deg, #8b3a3a 0%, #6b2a2a 100%);
    color: #f9f3e8;
    border-color: var(--hover-border);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 58, 58, 0.5);
}

.calc-nav .nav-link:hover .nav-icon {
    filter: brightness(1.3) sepia(0);
}

body.dark-mode .calc-nav .nav-link:hover {
    background: linear-gradient(135deg, #d4937c 0%, #c9a76f 100%);
    color: #1a1410;
    box-shadow: 0 4px 15px rgba(212, 147, 124, 0.5);
}

body.dark-mode .calc-nav .nav-link:hover .nav-icon {
    filter: brightness(1.4) sepia(0);
}

.calc-nav .nav-link.active {
    background: linear-gradient(135deg, #8b3a3a 0%, #6b2a2a 100%);
    color: #f9f3e8;
    border-color: #6b2a2a;
    box-shadow: 0 4px 15px rgba(139, 58, 58, 0.6);
}

.calc-nav .nav-link.active .nav-icon {
    filter: brightness(1.3) sepia(0);
}

body.dark-mode .calc-nav .nav-link.active {
    background: linear-gradient(135deg, #d4937c 0%, #c9a76f 100%);
    color: #1a1410;
    border-color: var(--hover-border);
    box-shadow: 0 4px 15px rgba(212, 147, 124, 0.6);
}

body.dark-mode .calc-nav .nav-link.active .nav-icon {
    filter: brightness(1.4) sepia(0);
}

/* Crafting Section */
.crafting-section {
    background: linear-gradient(135deg, #f9f3e8 0%, #f4e8d8 100%);
    padding: 30px;
    border: 3px solid var(--border-color);
    margin-bottom: 30px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

body.dark-mode .crafting-section {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--parchment) 100%);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.crafting-section h2 {
    color: var(--ink);
    margin-bottom: 15px;
    font-size: 2.2rem;
    font-family: 'Cinzel', 'Georgia', serif;
    font-weight: 700;
    letter-spacing: 2px;
}

.crafting-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.crafting-type-btn {
    padding: 15px 20px;
    background: var(--secondary-color);
    color: var(--text-light);
    border: 2px solid var(--border-color);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.crafting-type-btn:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(184, 134, 11, 0.3);
}

/* Main Content */
main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Calculator Section */
.calculator-section {
    background: linear-gradient(135deg, #f9f3e8 0%, #f4e8d8 100%);
    padding: 30px;
    border: 3px solid var(--border-color);
    margin-bottom: 30px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    position: relative;
    transition: all 0.3s ease;
}

body.dark-mode .calculator-section {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--parchment) 100%);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.calculator-section h2 {
    color: var(--ink);
    margin-bottom: 20px;
    font-size: 2.2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    font-family: 'Cinzel', 'Georgia', serif;
    font-weight: 700;
    letter-spacing: 2px;
}

/* Search and Filter */
.search-filter {
    margin-bottom: 25px;
}

.search-box {
    width: 100%;
    padding: 15px;
    background: #f9f3e8;
    border: 2px solid #b89968;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 15px;
    font-family: 'Crimson Text', 'Georgia', serif;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

body.dark-mode .search-box {
    background: #2a2218;
    color: var(--text-primary);
}

.search-box:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.1),
        0 0 15px rgba(139, 58, 58, 0.3);
}

body.dark-mode .search-box:focus {
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(212, 147, 124, 0.4);
}

.filter-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-controls label {
    color: var(--ink);
    font-weight: 700;
    font-family: 'Cinzel', 'Georgia', serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.filter-select {
    padding: 12px;
    background: #f9f3e8;
    border: 2px solid #b89968;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    font-family: 'Crimson Text', 'Georgia', serif;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

body.dark-mode .filter-select {
    background: #2a2218;
    color: var(--text-primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.1),
        0 0 15px rgba(139, 58, 58, 0.3);
}

body.dark-mode .filter-select:focus {
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(212, 147, 124, 0.4);
}

/* Recipes Grid */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Recipe Card */
.recipe-card {
    background: linear-gradient(135deg, #f9f3e8 0%, #f4e8d8 100%);
    border: 3px solid var(--border-color);
    padding: 25px;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    position: relative;
    cursor: pointer;
}

body.dark-mode .recipe-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--parchment) 100%);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.recipe-card::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px solid rgba(139, 111, 71, 0.2);
    pointer-events: none;
}

body.dark-mode .recipe-card::before {
    border: 1px solid rgba(201, 167, 111, 0.15);
}

.recipe-card:hover {
    border-color: var(--accent-color);
    box-shadow: 
        0 6px 20px rgba(139, 58, 58, 0.4),
        0 0 30px rgba(139, 58, 58, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
}

body.dark-mode .recipe-card:hover {
    box-shadow: 
        0 6px 20px rgba(212, 147, 124, 0.5),
        0 0 30px rgba(212, 147, 124, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.recipe-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    gap: 15px;
}

.recipe-title {
    flex: 1;
}

.recipe-name {
    color: var(--ink);
    font-size: 1.4rem;
    margin-bottom: 8px;
    font-family: 'Cinzel', 'Georgia', serif;
    font-weight: 700;
    letter-spacing: 1px;
}

.recipe-type {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: 'Crimson Text', 'Georgia', serif;
}

/* DC Badge */
.dc-badge {
    background: var(--accent);
    color: #000;
    padding: 5px 12px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 0.95rem;
    white-space: nowrap;
}

.dc-badge.dc-easy {
    background: #4caf50;
}

.dc-badge.dc-moderate {
    background: #ffc107;
}

.dc-badge.dc-hard {
    background: #ff9800;
}

.dc-badge.dc-very-hard {
    background: #ff5722;
}

.dc-badge.dc-extreme {
    background: #f44336;
}

/* Recipe Details */
.recipe-details {
    margin-top: 12px;
}

.click-hint {
    text-align: center;
    margin-top: 15px;
    color: var(--accent);
    font-size: 0.9em;
}

/* DC Breakdown */
.dc-breakdown {
    background: #0a0a0a;
    padding: 15px;
    margin-top: 15px;
    border-left: 3px solid var(--accent);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    color: #999;
}

.breakdown-item.total {
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
    padding-top: 10px;
    color: var(--text-light);
    font-weight: bold;
}

.breakdown-label {
    color: #999;
}

.breakdown-value {
    color: var(--accent);
    font-weight: bold;
}

.breakdown-item.total .breakdown-label {
    color: var(--text-light);
}

.breakdown-item.total .breakdown-value {
    color: var(--accent);
}

/* Stats Section */
.stats-section {
    margin-top: 30px;
}

.stats-section h2 {
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: #0a0a0a;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.stat-card h3 {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent);
}

/* Notes Section */
.notes-section {
    background: #1c1c1e;
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.notes-section h2 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.notes-section ul {
    list-style: none;
    padding: 0;
}

.notes-section li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-light);
}

.notes-section li:last-child {
    border-bottom: none;
}

.notes-section strong {
    color: var(--accent);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
    background: linear-gradient(135deg, #f4e8d8 0%, #e8dcc8 100%);
    border: 3px solid var(--border-color);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

body.dark-mode footer {
    background: linear-gradient(135deg, #2a2218 0%, #1a1410 100%);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

footer p {
    color: var(--text-primary);
    margin: 5px 0;
    font-family: 'Crimson Text', 'Georgia', serif;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

footer a:hover {
    text-decoration: underline;
    color: var(--hover-border);
}

/* Responsive Design */
@media (max-width: 768px) {
    .recipes-grid {
        grid-template-columns: 1fr;
    }

    .crafting-buttons {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 2rem;
        padding: 20px 10px;
    }

    header p {
        font-size: 1rem;
    }

    .calculator-section h2 {
        font-size: 1.5rem;
    }

    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }

    .back-button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .crafting-type-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .recipe-card {
        padding: 15px;
    }

    .footer-buttons {
        flex-direction: column;
        width: 100%;
    }

    .footer-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .recipe-name {
        font-size: 1.1rem;
    }

    .dc-badge {
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .search-box {
        font-size: 0.9rem;
    }
}

/* Tailoring Reference Table Modal */
.table-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

.table-modal-content {
    background: var(--card-bg);
    border-radius: 8px;
    border: 2px solid var(--accent);
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.9);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.table-modal-header h2 {
    color: var(--accent);
    font-size: 1.5rem;
    margin: 0;
    text-shadow: 0 0 10px rgba(184, 134, 11, 0.3);
}

.table-modal-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.table-modal-close:hover {
    background: rgba(196, 30, 58, 0.2);
    color: #c41e3a;
    transform: rotate(90deg);
}

.table-modal-body {
    padding: 30px;
}

.table-responsive {
    overflow-x: auto;
    margin-top: 15px;
}

.tailoring-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.tailoring-table thead {
    background: linear-gradient(135deg, var(--accent) 0%, #d4a017 100%);
}

.tailoring-table th {
    padding: 15px;
    text-align: left;
    color: #000;
    font-weight: 700;
    font-size: 1rem;
    border-right: 1px solid rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.tailoring-table th:last-child {
    border-right: none;
}

.tailoring-table tbody tr {
    transition: background 0.2s ease;
}

.tailoring-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.tailoring-table tbody tr:hover {
    background: rgba(184, 134, 11, 0.1);
}

.tailoring-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.95rem;
}

.tailoring-table td:first-child {
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}

.tailoring-table td:last-child {
    border-right: none;
}

.tailoring-table tbody tr:last-child td {
    border-bottom: none;
}

/* Mobile responsive for modal */
@media (max-width: 768px) {
    .table-modal {
        padding: 10px;
    }

    .table-modal-header {
        padding: 15px 20px;
    }

    .table-modal-header h2 {
        font-size: 1.2rem;
    }

    .table-modal-body {
        padding: 20px;
    }

    .tailoring-table th,
    .tailoring-table td {
        padding: 10px;
        font-size: 0.85rem;
    }

    .show-table-btn {
        margin-left: 0;
        width: 100%;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .table-responsive {
        font-size: 0.8rem;
    }

    .tailoring-table th,
    .tailoring-table td {
        padding: 8px;
        font-size: 0.8rem;
    }
}
