/* admin_panel/gift_admin.css */
:root {
    --text-dark: #1c1c1e;
    --text-secondary: #6c757d;
    --background-light: #f0f2f5; 
    --card-background: #ffffff;
    --border-color: #e5e5ea;
    --primary-blue: #007aff;
    --primary-green: #34c759;
    --primary-red: #ff3b30;
    --status-active-bg: #dcfce7; 
    --status-active-text: #166534; 
    --theme-red: #FF4D4D; 
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    display: flex; flex-direction: column; min-height: 100vh;
    background: var(--background-light); color: var(--text-dark);
}
main {
    flex: 1; padding: 1rem; max-width: 1400px; margin: 0 auto; width: 100%;
}

/* Header overrides */
body #header-placeholder { position: static; }
body header { 
    position: static !important; background: var(--background-light) !important; 
    border-bottom: 1px solid var(--border-color); padding: 0.75rem 1rem;
}
body #header-placeholder .header-logo { filter: none !important; height: 56px !important; }

/* Page Title */
.title-container {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 2.5rem;
}
.main-title {
    font-size: 2.5rem; font-weight: 800; text-transform: uppercase;
    line-height: 1; text-align: left;
}
.main-title span { display: block; }
.back-link {
    width: 40px; height: 40px;
    background: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; color: var(--text-dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Control Cards */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
.control-card {
    background: var(--card-background);
    border-radius: 26px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.control-card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 1.5rem; }

.upload-avatar-form, .add-tag-form { display: flex; flex-direction: column; gap: 1rem; }
.add-tag-form { flex-direction: row; }

.form-group select, .file-input-label, .add-tag-form input {
    width: 100%; padding: 0.8rem 1rem; border-radius: 26px;
    border: 1px solid var(--border-color); font-size: 1rem; background: var(--background-light);
}
.file-input-label { cursor: pointer; display: block; text-align: center; color: var(--text-secondary); }
#gift-file-input { display: none; }

.btn {
    padding: 0.8rem 1.2rem; border: none; border-radius: 26px; cursor: pointer;
    font-size: 1rem; font-weight: 600; transition: all 0.2s;
}
.btn-add, .btn-upload { background: var(--primary-blue); color: white; }

/* Tags */
.tags-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.tag-item { 
    background: #e5e5ea; color: var(--text-dark); 
    padding: 0.4rem 0.8rem; border-radius: 26px; 
    font-size: 0.9rem; display: inline-flex; align-items: center; gap: 0.5rem;
}
.delete-tag-btn {
    background: rgba(0,0,0,0.1); border: none; cursor: pointer;
    border-radius: 50%; width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
}
.delete-tag-btn img { width: 10px; height: 10px; }

/* Class Tabs */
.class-tabs { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
.class-tab {
    padding: 0.5rem 1.25rem; border-radius: 50px; background: #ffffff;
    border: 1px solid var(--border-color); color: var(--text-secondary);
    font-size: 0.85rem; font-weight: 700; cursor: pointer;
    transition: all 0.2s ease;
}
.class-tab.active { background: var(--text-dark); color: white; border-color: var(--text-dark); }

/* Gallery Header */
.gallery-header-info { display: flex; flex-direction: column; gap: 12px; margin-bottom: 1.5rem; }
.section-title-group { display: flex; align-items: center; gap: 8px; }
.section-title { font-size: 1.3rem; font-weight: 800; }
.section-price-group {
    display: flex; align-items: center; gap: 15px; width: fit-content;
    background: white; padding: 10px 20px; border-radius: 26px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid var(--border-color);
}
.section-price-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}
.category-price-input {
    width: 70px; border: none; background: var(--background-light);
    padding: 6px 10px; border-radius: 12px; font-weight: 800; text-align: center;
    font-size: 1rem;
    color: var(--text-dark);
}
.category-price-input:focus { outline: none; box-shadow: 0 0 0 2px var(--primary-blue); }
.btn-save-price { background: var(--theme-red); color: white; padding: 6px 14px; font-size: 0.85rem; border-radius: 10px; font-weight: 600; cursor: pointer; }

/* Grid */
.avatar-grid {
    display: grid; gap: 1.5rem;
    grid-template-columns: repeat(2, 1fr); 
}
@media (min-width: 768px) { .avatar-grid { grid-template-columns: repeat(4, 1fr); } }

.avatar-card {
    background: var(--card-background); border-radius: 26px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); overflow: hidden;
    display: flex; flex-direction: column; transition: transform 0.2s;
}
.avatar-card:hover { transform: translateY(-2px); }

.avatar-card-img-container {
    width: 100%; padding-top: 100%; position: relative; background: #f9f9f9;
}
.avatar-card img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: contain; padding: 15%;
}

.delete-avatar-btn-image {
    position: absolute; top: 12px; right: 12px;
    background: rgba(0, 0, 0, 0.4); border: none; border-radius: 50% !important;
    width: 32px !important; height: 32px !important; cursor: pointer; 
    display: flex !important; align-items: center !important; justify-content: center !important; 
    color: white; padding: 0 !important;
    transition: background-color 0.2s;
}
.delete-avatar-btn-image:hover { background-color: var(--primary-red); }
.delete-avatar-btn-image svg { width: 18px; height: 18px; display: block; }

.avatar-card-info { padding: 1.2rem; display: flex; flex-direction: column; gap: 0.75rem; }
.avatar-name-input, .tag-select {
    width: 100%; padding: 0.6rem; border: 1px solid var(--border-color);
    border-radius: 12px; font-size: 0.9rem; background: var(--background-light);
}
.avatar-tags-display { display: flex; flex-wrap: wrap; gap: 0.4rem; min-height: 24px; }
.avatar-tag { background: var(--primary-blue); color: white; padding: 0.2rem 0.6rem; border-radius: 10px; font-size: 0.75rem; display: flex; align-items: center; gap: 4px; }
.remove-tag-btn { background: none; border: none; color: inherit; cursor: pointer; font-size: 1.1rem; }

/* File Meta Badges */
.avatar-file-meta-v2024 { display: flex; gap: 6px; margin-bottom: 0.25rem; width: 100%; }
.ae-meta-badge-v2024 { padding: 2px 6px; border-radius: 6px; font-size: 0.65rem; font-weight: 700; color: white; text-transform: uppercase; }
.ae-meta-badge-v2024.format-jpg { background-color: var(--primary-blue); }
.ae-meta-badge-v2024.size-badge { background-color: #e5e5ea; color: var(--text-secondary); }

#status-message {
    position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%);
    padding: 0.8rem 1.5rem; border-radius: 50px; color: white; font-weight: 600;
    z-index: 10000; opacity: 0; transition: all 0.4s; backdrop-filter: blur(10px);
}
#status-message.success { background-color: rgba(52, 199, 89, 0.95); }
#status-message.error { background-color: rgba(255, 59, 48, 0.95); }
#status-message.visible { opacity: 1; bottom: 40px; }