/* gift_admin.css - По аналогии с avatar_editor.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;
    --primary-orange: #ff9500;
}

* { 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;
}
body #header-placeholder .burger-btn { color: var(--text-dark); }

/* 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);
}
.back-link svg { width: 24px; height: 24px; }

/* Control Card (Tags) */
.control-card {
    background: var(--card-background);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.control-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* Tags */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    min-height: 40px;
}

.tag-item {
    background: #e5e5ea;
    color: var(--text-dark);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tag-item button {
    background: transparent;
    border: none;
    color: var(--primary-red);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    line-height: 1;
}

.add-tag-form {
    display: flex;
    gap: 0.5rem;
}

.add-tag-form input {
    flex: 1;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    background: var(--background-light);
}

/* Category Section */
.category-section {
    background: var(--card-background);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.price-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-control label {
    font-weight: 500;
    color: var(--text-secondary);
}

.price-input {
    width: 100px;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    background: var(--background-light);
}

/* Gifts Grid */
.gifts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.gift-card {
    background: var(--background-light);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gift-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.gift-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0.8rem;
}

.gift-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
}

.gift-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: center;
}

.gift-tag {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-blue);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
}

/* Buttons */
.btn {
    padding: 0.8rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-add {
    background: var(--primary-blue);
    color: white;
}

.btn-save-price {
    background: var(--primary-green);
    color: white;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
}

.btn-secondary {
    background: #e5e5ea;
    color: var(--text-dark);
}

.btn:hover {
    opacity: 0.9;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    background: var(--background-light);
}

.tags-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tags-checkboxes label {
    background: #e5e5ea;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tags-checkboxes input[type="checkbox"] {
    cursor: pointer;
}

.gift-preview {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 8px;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-actions .btn {
    flex: 1;
}

/* Status Message */
#status-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background: var(--primary-green);
    color: white;
    font-weight: 500;
    display: none;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#status-message.error {
    background: var(--primary-red);
}

#status-message.show {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Loader */
.loader {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .gifts-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}