/* ===== ADMIN PANEL REDESIGN ===== */
/* თქვენი მთავარი UI სტილის მიხედვით */

#admin-panel {
    display: none;
    min-height: 100vh;
    background: var(--white);
    padding: 0;
}

#admin-panel.active {
    display: block !important;
}

/* ===== ADMIN HEADER ===== */
.admin-header {
    position: sticky;
    top: 0;
    background: var(--black);
    color: var(--white);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-bottom: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-header h1 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1.5px;
    margin: 0;
    color: var(--white);
}

.btn-logout {
    background: var(--white);
    color: var(--black);
    padding: 10px 20px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'BPG Nino Mtavruli', sans-serif;
    letter-spacing: 1px;
}

.btn-logout:hover {
    background: var(--gray-bg);
    transform: translateY(-1px);
}

/* ===== ADMIN CONTAINER ===== */
.admin-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 25px;
}

/* ===== ADMIN CONTROLS ===== */
.admin-controls {
    margin-bottom: 32px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--black);
    color: var(--white);
    padding: 14px 24px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'BPG Nino Mtavruli', sans-serif;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--text-gray);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.btn-secondary {
    background: var(--white);
    color: var(--black);
    padding: 14px 24px;
    border: 2px solid var(--black);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'BPG Nino Mtavruli', sans-serif;
    letter-spacing: 1px;
}

.btn-secondary:hover {
    background: var(--black);
    color: var(--white);
}

/* ===== PRODUCTS GRID ===== */
.admin-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.admin-product-card {
    background: var(--white);
    padding: 0;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.admin-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--black);
}

.admin-product-card img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    background: var(--gray-bg);
    display: block;
}

.admin-product-info {
    padding: 16px;
}

.admin-product-info h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-gray);
    letter-spacing: 0.3px;
    line-height: 1.4;
}

.admin-product-info p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-family: 'TBC Contractica', sans-serif;
}

/* ===== CATEGORY BADGES ===== */
.category-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.category-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--black);
    color: var(--white);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.category-badge:first-child {
    background: var(--text-gray);
}

/* ===== PRODUCT ACTIONS ===== */
.admin-product-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-edit, .btn-delete {
    flex: 1;
    padding: 10px;
    border: none;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'BPG Nino Mtavruli', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    letter-spacing: 0.5px;
}

.btn-edit {
    background: var(--black);
    color: var(--white);
}

.btn-edit:hover {
    background: var(--text-gray);
}

.btn-delete {
    background: var(--white);
    color: var(--black);
    border: 2px solid var(--black);
}

.btn-delete:hover {
    background: var(--black);
    color: var(--white);
}

.btn-edit svg, .btn-delete svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* ===== FORM OVERLAY ===== */
.admin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

.admin-overlay.active {
    opacity: 1;
    visibility: visible;
}

.admin-form-container {
    background: var(--white);
    padding: 32px 24px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.admin-form-container h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 32px;
    letter-spacing: 1.2px;
    color: var(--text-gray);
}

/* ===== FORM STYLES ===== */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.8px;
    color: var(--text-gray);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    background: var(--white);
    font-family: 'BPG Nino Mtavruli', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    color: var(--text-gray);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--black);
    box-shadow: 0 0 0 1px var(--black);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: 'TBC Contractica', sans-serif;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='black' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* ===== CATEGORIES GRID ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 12px;
    padding: 16px;
    background: var(--gray-bg);
    border: 1px solid var(--border-color);
}

.category-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--white);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    font-weight: 500;
    user-select: none;
}

.category-checkbox-label:hover {
    border-color: var(--black);
    background: var(--white);
}

.category-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--black);
}

.category-checkbox-label input[type="checkbox"]:checked + span {
    font-weight: 600;
}

.category-checkbox-label:has(input[type="checkbox"]:checked) {
    border-color: var(--black);
    background: var(--gray-bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ===== IMAGE UPLOAD PREVIEW ===== */
.image-preview-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 3/4;
    background: var(--gray-bg);
    border: 1px solid var(--border-color);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.remove-image {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: var(--black);
    color: var(--white);
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300;
}

.remove-image:hover {
    background: var(--text-gray);
    transform: rotate(90deg);
}

/* ===== FORM ACTIONS ===== */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

/* ===== ADMIN NOTIFICATIONS ===== */
.admin-notification {
    position: fixed;
    top: 80px;
    right: 24px;
    background: var(--black);
    color: var(--white);
    padding: 16px 24px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.admin-notification.show {
    transform: translateX(0);
}

.admin-notification.success {
    background: var(--black);
}

.admin-notification.error {
    background: var(--black);
}

.admin-notification.info {
    background: var(--black);
}

/* ===== ADMIN LOGIN MODAL ===== */
#admin-login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

#admin-login-modal.active {
    display: flex !important;
}

.admin-login-container {
    background: var(--white);
    padding: 40px 32px;
    max-width: 400px;
    width: 100%;
}

.admin-login-container h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 32px;
    text-align: center;
    letter-spacing: 1.5px;
    color: var(--text-gray);
}

/* ===== NO PRODUCTS MESSAGE ===== */
.no-products {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 13px;
    grid-column: 1 / -1;
    font-family: 'TBC Contractica', sans-serif;
}

/* ===== TABLET RESPONSIVE ===== */
@media screen and (min-width: 640px) {
    .admin-container {
        padding: 32px;
    }
    
    .admin-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 32px;
    }
    
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .image-preview-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== DESKTOP RESPONSIVE ===== */
@media screen and (min-width: 768px) {
    .admin-header {
        padding: 20px 50px;
    }
    
    .admin-header h1 {
        font-size: 18px;
    }
    
    .admin-container {
        padding: 50px;
    }
    
    .admin-products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 50px;
    }
    
    .admin-form-container {
        padding: 50px;
    }
    
    .admin-form-container h2 {
        font-size: 18px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .form-actions {
        flex-wrap: nowrap;
    }
    
    .btn-primary, .btn-secondary {
        padding: 16px 32px;
        font-size: 13px;
    }
}

/* ===== LARGE DESKTOP ===== */
@media screen and (min-width: 1024px) {
    .admin-products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .categories-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .image-preview-container {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media screen and (min-width: 1440px) {
    .admin-container {
        max-width: 1600px;
        margin: 0 auto;
    }
    
    .admin-products-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ===== IMAGE UPLOAD PREVIEW ===== */
.image-preview-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 3/4;
    background: var(--gray-bg);
    border: 1px solid var(--border-color);
    cursor: move;
    transition: all 0.3s ease;
}

.image-preview-item:hover {
    border-color: var(--black);
    transform: scale(1.02);
}

.image-preview-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.drag-handle {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 28px;
    height: 28px;
    background: var(--black);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: move;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-preview-item:hover .drag-handle {
    opacity: 1;
}

.remove-image {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    background: var(--black);
    color: var(--white);
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300;
    z-index: 2;
    opacity: 0;
}

.image-preview-item:hover .remove-image {
    opacity: 1;
}

.remove-image:hover {
    background: var(--text-gray);
    transform: rotate(90deg);
}