/* ============================================
   HDHS Admin Panel Styles
   ============================================ */

:root {
    --primary: #455e3e;
    --primary-dark: #2d3f28;
    --primary-light: #6b8c5e;
    --accent: #c9a84c;
    --accent-light: #e8d48b;
    --dark: #1a1a1a;
    --dark-2: #2d2d2d;
    --light: #f0f2f5;
    --white: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --danger: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
    --font-sans: 'Noto Sans TC', sans-serif;
    --font-display: 'Oswald', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--light);
    color: var(--text);
    min-height: 100vh;
}

/* ============================================
   Login Screen
   ============================================ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d3f28 100%);
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.login-header h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.login-header p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 5px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    font-family: var(--font-sans);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(69,94,62,0.1);
}

.login-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-bottom: 15px;
    display: none;
}

.login-error.show {
    display: block;
}

/* ============================================
   Admin Dashboard
   ============================================ */
.admin-dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-nav {
    background: var(--dark);
    color: var(--white);
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-logo {
    font-family: var(--font-display);
    font-size: 1.3rem;
    letter-spacing: 2px;
    color: var(--accent);
}

.admin-beta {
    background: var(--accent);
    color: var(--dark);
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-email {
    font-size: 0.85rem;
    opacity: 0.7;
}

.btn-logout {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    font-family: var(--font-sans);
}

.btn-logout:hover {
    background: rgba(255,255,255,0.2);
}

/* ============================================
   Admin Body Layout
   ============================================ */
.admin-body {
    display: flex;
    flex: 1;
}

.admin-sidebar {
    width: 220px;
    background: var(--white);
    border-right: 1px solid #e0e0e0;
    padding: 15px 10px;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 15px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
    transition: var(--transition);
    font-family: var(--font-sans);
    text-align: left;
    margin-bottom: 4px;
}

.sidebar-btn:hover {
    background: var(--light);
}

.sidebar-btn.active {
    background: var(--primary);
    color: var(--white);
}

.sidebar-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.admin-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    max-height: calc(100vh - 60px);
}

/* ============================================
   Content Sections
   ============================================ */
.content-section {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.card-header h3 {
    font-size: 1.1rem;
    color: var(--dark);
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: var(--transition);
    font-family: var(--font-sans);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(69,94,62,0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: var(--font-sans);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   Items List
   ============================================ */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--light);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: move;
}

.item-card:hover {
    background: #e8e8e8;
}

.item-card.dragging {
    opacity: 0.5;
    background: var(--accent-light);
}

.item-card .item-info {
    flex: 1;
}

.item-card .item-info h4 {
    font-size: 0.95rem;
    color: var(--dark);
    margin-bottom: 3px;
}

.item-card .item-info p {
    font-size: 0.8rem;
    color: var(--text-light);
}

.item-card .item-actions {
    display: flex;
    gap: 8px;
}

.item-card .drag-handle {
    cursor: grab;
    color: var(--text-light);
    font-size: 1.2rem;
    padding: 5px;
}

.item-card .drag-handle:active {
    cursor: grabbing;
}

/* ============================================
   Image Upload
   ============================================ */
.image-upload {
    border: 2px dashed #ccc;
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.image-upload:hover {
    border-color: var(--primary);
    background: rgba(69,94,62,0.05);
}

.image-upload.dragover {
    border-color: var(--accent);
    background: rgba(201,168,76,0.1);
}

.image-upload-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.image-upload p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.image-preview {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-top: 10px;
}

/* ============================================
   Toast
   ============================================ */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    border-radius: var(--radius-sm);
    color: var(--white);
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.info {
    background: var(--primary);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text);
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--dark);
    text-transform: uppercase;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 5px;
}

.modal-close:hover {
    color: var(--danger);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 60px;
        padding: 10px 5px;
    }
    
    .sidebar-btn span:not(.sidebar-icon) {
        display: none;
    }
    
    .sidebar-btn {
        justify-content: center;
        padding: 12px;
    }
    
    .admin-content {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .login-card {
        padding: 30px 20px;
    }
}