/* General Styling & Theme */
/* --- START: FONT UPDATE --- */
body { background-color: #1a1a1a; background-image: url('https://www.transparenttextures.com/patterns/dark-metal.png'); color: #e0e0e0; font-family: 'Kanit', sans-serif; margin: 0; padding: 0; line-height: 1.7; font-size: 16px; }
/* --- END: FONT UPDATE --- */

h1, h2 { font-family: 'Cinzel', serif; color: #ff8c00; text-shadow: 2px 2px 4px #000; text-align: center; }
.container { max-width: 1200px; margin: 20px auto; padding: 20px; background: rgba(0, 0, 0, 0.6); border: 1px solid #444; border-radius: 8px; box-shadow: 0 0 15px rgba(255, 140, 0, 0.3); }

/* Header & Navigation */
.main-header { background: linear-gradient(to bottom, #333, #1a1a1a); padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #ff8c00; }
.main-header h1 { margin: 0; font-size: 2em; }
.home-button { color: #ff8c00; font-size: 1.8em; text-decoration: none; transition: color 0.3s, transform 0.3s; }
.home-button:hover { color: #ffae42; transform: scale(1.1); }
.user-actions { display: flex; align-items: center; gap: 15px; }
.welcome-msg { font-style: italic; color: #ccc; }
.login-form { display: flex; gap: 5px; }
.login-form input, .form-input { padding: 8px 12px; border-radius: 4px; border: 1px solid #555; background: #2a2a2a; color: #fff; width: 100%; box-sizing: border-box; height: 40px; font-family: 'Kanit', sans-serif; }
.action-button, .login-form button { background-color: #c04000; color: white; padding: 8px 15px; border: none; border-radius: 5px; text-decoration: none; cursor: pointer; font-family: 'Cinzel', serif; transition: background-color 0.3s, box-shadow 0.3s; box-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.action-button:hover, .login-form button:hover { background-color: #ff4500; box-shadow: 0 0 10px rgba(255, 69, 0, 0.7); }

/* Blueprint Grid */
.blueprint-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 20px; margin-top: 20px; }
.blueprint-item { background: #222; border: 2px solid #444; border-radius: 8px; padding: 10px; text-align: center; cursor: pointer; transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s; }
.blueprint-item:hover { transform: translateY(-5px); border-color: #ff8c00; box-shadow: 0 5px 15px rgba(255, 140, 0, 0.4); }
.blueprint-item img { width: 84px; height: 84px; object-fit: cover; border-radius: 5px; background-color: #333; }
.blueprint-item p { margin: 10px 0 0; color: #ddd; font-size: 0.9em; }

/* Modal Styling */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0, 0, 0, 0.85); animation: modalFadeIn 0.3s; }
@keyframes modalFadeIn { from { background-color: rgba(0,0,0,0); } to { background-color: rgba(0,0,0,0.85); } }
.modal-content { background-color: #1c1c1c; background-image: url('https://www.transparenttextures.com/patterns/crissxcross.png'); margin: 5% auto; padding: 30px; border: 2px solid #ff8c00; border-radius: 10px; width: 80%; max-width: 900px; box-shadow: 0 0 25px rgba(255, 140, 0, 0.5); position: relative; animation: modalContentSlideIn 0.5s; }
@keyframes modalContentSlideIn { from {opacity: 0; transform: translateY(-50px);} to {opacity: 1; transform: translateY(0);} }
.close-button { color: #aaa; position: absolute; top: 15px; right: 25px; font-size: 28px; font-weight: bold; cursor: pointer; transition: color 0.2s; }
.close-button:hover, .close-button:focus { color: #ff8c00; text-decoration: none; }
#modal-body, #details-modal-body { max-height: 80vh; overflow-y: auto; padding-right: 15px; }

/* Secondary Details Modal */
.details-modal-content { max-width: 700px; border-color: #c04000; }
#details-modal-title { color: #ffae42; border-bottom: 1px solid #555; padding-bottom: 10px; margin-bottom: 15px; }
#details-modal-body { color: #ddd; font-family: inherit; }


/* Blueprint Details View */
.blueprint-details-grid { display: grid; grid-template-columns: 300px 1fr; gap: 25px; align-items: start; }
.blueprint-details-grid .info-column h2 { text-align: left; margin-top: 0; }
.blueprint-details-grid img.large-image { width: 100%; border-radius: 8px; border: 2px solid #444; }
.details-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.detail-tag { background-color: #c04000; color: white; padding: 4px 12px; border-radius: 15px; font-size: 0.8em; font-family: 'Kanit', sans-serif; font-weight: 500; }
.creator-tag { background-color: #5a2d0c; }
.collapsible-container { margin-top: 15px; display: flex; flex-direction: column; gap: 10px; }
details.collapsible-section { border: 1px solid #3a3a3a; border-radius: 6px; background-color: #2a2a2a; transition: background-color 0.3s; }
details.collapsible-section[open] { background-color: #333; }
details.collapsible-section summary { padding: 12px 15px; cursor: pointer; font-weight: bold; color: #ffae42; font-family: 'Cinzel', serif; display: flex; justify-content: space-between; align-items: center; list-style: none; outline: none; }
details.collapsible-section summary::-webkit-details-marker { display: none; }
details.collapsible-section summary::after { content: '▼'; font-size: 0.8em; margin-left: 10px; transition: transform 0.3s; }
details[open] > summary::after { transform: rotate(180deg); }
.collapsible-content { padding: 15px; border-top: 1px solid #444; background-color: rgba(0,0,0,0.2); color: #ddd; line-height: 1.7; font-family: inherit; }

/* Recipe Section */
.recipe-section { margin-top: 30px; border-top: 2px solid #ff8c00; padding-top: 20px; }
.recipe-section h3 { color: #ffae42; text-align: left; }
.recipe-tabs { display: flex; border-bottom: 2px solid #555; margin-bottom: 15px; }
.tab-link { background: #333; border: 1px solid #444; border-bottom: none; padding: 10px 20px; cursor: pointer; border-radius: 5px 5px 0 0; margin-right: 5px; color: #ccc; font-family: 'Cinzel', serif; transition: background 0.3s, color 0.3s; }
.tab-link.active { background: #ff8c00; color: #111; border-color: #ff8c00; }
.tab-content { display: none; padding: 15px; border: 1px solid #444; border-radius: 0 5px 5px 5px; background: rgba(0,0,0,0.3); }
.tab-content.active { display: block; }
.recipe-creator { font-style: italic; color: #bbb; margin-bottom: 15px; }
.recipe-action-buttons { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px dashed #555; }
.details-popup-button { background: linear-gradient(145deg, #4a4a4a, #2a2a2a); color: #ffae42; border: 1px solid #666; padding: 8px 15px; border-radius: 6px; font-family: 'Kanit', sans-serif; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.4); display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.details-popup-button:hover { background: linear-gradient(145deg, #c04000, #ff4500); color: #fff; border-color: #ff8c00; transform: translateY(-2px); box-shadow: 0 4px 8px rgba(255, 69, 0, 0.4); }
.details-popup-button.quality { background: linear-gradient(145deg, #005a5a, #003c3c); color: #7fffd4; border-color: #00796b; }
.details-popup-button.quality:hover { background: linear-gradient(145deg, #00796b, #004d40); color: #fff; border-color: #7fffd4; box-shadow: 0 4px 8px rgba(127, 255, 212, 0.4); }
.details-popup-button.edit { background: linear-gradient(145deg, #6d28d9, #4c1d95); color: #f5d0fe; border-color: #8b5cf6; }
.details-popup-button.edit:hover { background: linear-gradient(145deg, #7c3aed, #5b21b6); color: #fff; border-color: #a78bfa; box-shadow: 0 4px 8px rgba(167, 139, 250, 0.4); }
.materials-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.materials-table th, .materials-table td { padding: 10px; border: 1px solid #444; text-align: left; }
.materials-table th { background-color: #2a2a2a; color: #ff8c00; }

/* Add Recipe Form */
.recipe-topic-block { border: 1px solid #444; padding: 15px; border-radius: 5px; margin-bottom: 15px; }
.add-material-btn, #add-topic-btn { background: #006400; color: white; border: 1px solid #008000; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-family: 'Kanit', sans-serif; font-size: 0.9em; transition: all 0.2s ease; display: inline-block; }
.add-material-btn { margin-top: 10px; }
#add-topic-btn { margin: 15px 0; }
.add-material-btn:hover, #add-topic-btn:hover { background: #008000; border-color: #228B22; box-shadow: 0 0 8px rgba(0, 128, 0, 0.5); }
.material-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.material-row .select2-container { flex: 1 1 40%; min-width: 150px; }
.material-row .quantity-input { flex: 0 0 90px; }
.material-row .form-input:not(.quantity-input) { flex: 1 1 30%; }
.delete-material-btn { flex-shrink: 0; background: #5a2d0c; border: 1px solid #8c5a3e; color: white; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 1.5rem; line-height: 38px; text-align: center; padding: 0; transition: all 0.2s ease; }
.delete-material-btn:hover { background: #c04000; border-color: #ff8c00; transform: scale(1.1); }

/* Scrollbar for Select2 Dropdown */
.item-dropdown-container .select2-results__options { max-height: 250px; overflow-y: auto; }

/* --- START: NEW FONT SIZE BUTTON STYLE --- */
.wysiwygEditor-toolbar ul li .wysiwyg-font-size-button i {
    font-style: normal;
    font-weight: bold;
}
/* --- END: NEW FONT SIZE BUTTON STYLE --- */
