:root {
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #333;
    --primary-color: #2c3e50;
    --accent-color: #27ae60;
    --danger-color: #c0392b;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 10px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 { 
    color: var(--primary-color); 
    margin-bottom: 5px; 
    font-size: 1.8rem; 
}

.stats {
    font-size: 1rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 15px;
}

/* === main page === */
.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.controls select, 
.controls input, 
.controls button {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
}

.controls button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.controls button:hover { opacity: 0.9; }

/* === catalog === */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin: 0 auto 10px auto;
    border-radius: 50%;
}

.card h3 { margin: 5px 0; font-size: 1.1rem; }
.card .meta { color: #7f8c8d; font-size: 0.9rem; margin-bottom: 10px; }

.tracker {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 5px;
    border-top: 1px solid #eee;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-top: 10px;
    text-align: center;
    width: calc(100% - 24px);
}

.status-owned {
    background-color: #c6f6d5;
    color: #22543d;
    border: 1px solid #98e6b1;
}

.status-missing {
    background-color: #edf2f7;
    color: #718096;
    border: 1px solid #e2e8f0;
}

.tracker-layout-wrapper {
    justify-content: center; 
    padding: 5px 0;
}

.header-back-link {
    font-weight: bold;
    display: inline-block;
    margin-top: 5px;
    color: var(--primary-color);
    text-decoration: none;
}

.admin-form { 
    max-width: 500px; 
    margin: 20px auto; 
    padding: 20px; 
    background: white; 
    border-radius: 8px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
    text-align: left;
}

.admin-form div { 
    margin-bottom: 12px; 
}

.admin-form input, 
.admin-form select { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    box-sizing: border-box; 
    font-size: 0.95rem;
}

.admin-form button[type="submit"] {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
}

.admin-form button[type="submit"]:hover {
    opacity: 0.9;
}

.form-field-label {
    display: block; 
    margin-bottom: 5px; 
    font-size: 0.9rem; 
    color: #666;
    font-weight: 500;
}

.current-image-status-span {
    font-size: 0.85rem; 
    display: block; 
    margin-top: 6px; 
    padding: 4px 8px; 
    border-radius: 4px;
}

.cancel-edit-form-btn {
    width: 100%;
    padding: 10px;
    background: #edf2f7; 
    color: #4a5568; 
    border: none; 
    border-radius: 6px;
    margin-top: 8px; 
    display: none;
    cursor: pointer;
    font-weight: bold;
}

.coin-manager-item { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px 15px; 
    background: white; 
    margin-bottom: 8px; 
    border-radius: 6px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); 
}

.btn-group { 
    display: flex; 
    gap: 8px;
    flex-shrink: 0;
}

.coin-manager-item .btn-group button { 
    padding: 6px 14px !important; 
    border-radius: 4px !important; 
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    width: auto !important;
    display: inline-block !important;
}

.btn-edit { 
    background-color: #3182ce; 
    color: white; 
    border: none; 
    cursor: pointer; 
}

.btn-danger { 
    background-color: var(--danger-color); 
    color: white; 
    border: none; 
    cursor: pointer; 
}

.search-container { 
    max-width: 800px; 
    margin: 20px auto; 
    padding: 0 20px; 
}

.search-input { 
    width: 100%; 
    padding: 12px; 
    font-size: 1rem; 
    border-radius: 6px; 
    border: 1px solid #cbd5e0; 
    box-sizing: border-box; 
    background: white;
}

.badge-qty { 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-weight: bold; 
    font-size: 0.85rem; 
}

.badge-img { 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-size: 0.9rem; 
    margin-left: 5px; 
    display: inline-block; 
    vertical-align: middle; 
}

.admin-logout-container {
    text-align: right; 
    margin-bottom: 20px;
}

.admin-logout-link {
    color: var(--danger-color); 
    font-weight: bold;
    text-decoration: none;
}

.admin-section-wrapper {
    max-width: 800px; 
    margin: 0 auto; 
    padding: 0 20px;
}

.quick-search-wrapper {
    margin-top: 30px; 
    margin-bottom: 10px;
}

.inline-edit-form {
    width: 100%; 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px; 
    background: #f7fafc; 
    padding: 15px; 
    border-radius: 6px; 
    box-sizing: border-box;
}

.inline-form-fullwidth-header {
    grid-column: span 2;
    text-align: left;
}

.inline-form-field-label {
    font-size: 0.8rem; 
    color: #666; 
    display: block; 
    margin-bottom: 4px;
    text-align: left;
}

.inline-edit-form input {
    width: 100% !important; 
    padding: 6px !important; 
    box-sizing: border-box !important;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
}

.inline-form-file-input {
    padding: 4px 0 !important;
}

.inline-image-info-wrapper {
    margin-top: 4px;
    text-align: left;
}

.inline-form-actions-panel {
    grid-column: span 2; 
    display: flex; 
    justify-content: flex-end; 
    gap: 10px; 
    margin-top: 10px;
}

.inline-form-actions-panel button {
    width: auto !important;
}

.inline-btn-cancel {
    background: #edf2f7; 
    color: #4a5568; 
    border: none; 
    padding: 6px 12px; 
    border-radius: 4px; 
    cursor: pointer;
    font-weight: bold;
}

.inline-btn-save {
    background: #3182ce; 
    color: white; 
    border: none; 
    padding: 6px 12px; 
    border-radius: 4px; 
    cursor: pointer;
    font-weight: bold;
}


/* tablets */
@media (min-width: 480px) {
    body { padding: 20px; }
    h1 { font-size: 2.2rem; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* desktops */
@media (min-width: 768px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
    .card img { width: 140px; height: 140px; }
}
/* Optional: small styling adjustment for the new checkbox container */
 .checkbox-container {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            user-select: none;
            font-family: sans-serif;
            font-size: 14px;
}
.checkbox-container input {
            cursor: pointer;
            width: 16px;
            height: 16px;
}
/* Container for detailed category breakdown */
.stats-details {
            margin-top: 10px;
            font-size: 0.9em;
            color: #666;
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            justify-content: center;
}
.stats-badge-item {
            background: #f0f0f0;
            padding: 4px 10px;
            border-radius: 12px;
            border: 1px solid #ddd;
}
.checkbox-container {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            user-select: none;
            font-family: sans-serif;
            font-size: 14px;
 }
.checkbox-container input {
            cursor: pointer;
            width: 16px;
            height: 16px;
}
