/* Admin Panel Styles - The House of the Potter */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: #f5f5f5;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #1e293b;
}

.login-container {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.login-container h1 {
    font-size: 1.25rem;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.login-container h2 {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: normal;
    margin-bottom: 1.5rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.5;
}

.btn:hover { background: #f9fafb; text-decoration: none; }
.btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: #16a34a; color: #fff; border-color: #16a34a; }
.btn-success:hover { background: #15803d; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.btn-full { width: 100%; }
.btn + .btn { margin-left: 0.5rem; }

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* Admin Layout */
.admin-header {
    background: #1e293b;
    color: #fff;
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-header h1 {
    font-size: 1rem;
    font-weight: 600;
}

.admin-header h1 a {
    color: #fff;
    text-decoration: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: #94a3b8;
    font-size: 0.875rem;
}

.admin-body {
    display: flex;
    min-height: calc(100vh - 56px);
}

/* Sidebar */
.admin-sidebar {
    width: 220px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    padding: 1rem 0;
    flex-shrink: 0;
}

.nav-list {
    list-style: none;
}

.nav-list li a {
    display: block;
    padding: 0.5rem 1.5rem;
    color: #374151;
    font-size: 0.875rem;
}

.nav-list li a:hover {
    background: #f3f4f6;
    text-decoration: none;
}

.nav-list li a.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

.nav-section {
    padding: 1rem 1.5rem 0.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    font-weight: 600;
}

/* Main Content */
.admin-content {
    flex: 1;
    padding: 2rem;
    max-width: 1000px;
}

.admin-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

.admin-content h3 {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.75rem;
    color: #374151;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2563eb;
}

.stat-label {
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Info Card */
.info-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.info-card h3 {
    margin-top: 0;
}

.info-card ol {
    padding-left: 1.5rem;
}

.info-card li {
    margin-bottom: 0.25rem;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 1rem;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #2563eb;
    background: #eff6ff;
}

.upload-prompt p {
    margin: 0.25rem 0;
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.image-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.5rem;
    text-align: center;
}

.image-card img {
    max-width: 100%;
    height: 100px;
    object-fit: contain;
    display: block;
    margin: 0 auto 0.5rem;
}

.image-placeholder {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #9ca3af;
    font-size: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.image-id {
    font-size: 0.7rem;
    color: #6b7280;
    word-break: break-all;
    margin-bottom: 0.5rem;
}

/* Item List */
.item-list {
    list-style: none;
}

.item-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    cursor: grab;
}

.item-row:active { cursor: grabbing; }
.item-row.dragging { opacity: 0.5; }

.drag-handle {
    color: #9ca3af;
    font-size: 1.2rem;
    cursor: grab;
    user-select: none;
}

.item-thumb {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    background: #f3f4f6;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.item-meta {
    font-size: 0.75rem;
    color: #6b7280;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Modal / Edit Panel */
.edit-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.edit-panel h3 {
    margin-top: 0;
}

/* Option rows (price/catalog/description) */
.option-rows {
    margin: 1rem 0;
}

.option-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr auto;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.option-row input {
    padding: 0.375rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.breadcrumbs a { color: #6b7280; }
.breadcrumbs span { margin: 0 0.25rem; }

/* Generate Page */
.generate-output {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.8rem;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    margin-top: 1rem;
}

.generate-output .success { color: #4ade80; }
.generate-output .error { color: #f87171; }
.generate-output .info { color: #93c5fd; }

/* Text utilities */
.text-muted { color: #9ca3af; font-size: 0.8rem; }
.text-warning { color: #92400e; }

/* Responsive */
@media (max-width: 768px) {
    .admin-body { flex-direction: column; }
    .admin-sidebar { width: 100%; border-right: none; border-bottom: 1px solid #e5e7eb; }
    .nav-list { display: flex; flex-wrap: wrap; padding: 0 0.5rem; }
    .nav-list li a { padding: 0.5rem 0.75rem; }
    .nav-section { display: none; }
    .admin-content { padding: 1rem; }
    .option-row { grid-template-columns: 1fr; }
}
