.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.modal-content {
    position: relative;
    background: var(--dark, #0f172a);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    padding: 30px;
    max-width: 550px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    color: var(--light, #f8fafc);
    font-size: 1.4rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--light, #f8fafc);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.modal-close:hover {
    color: var(--primary, #6366f1);
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body label {
    display: block;
    color: var(--light, #f8fafc);
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.modal-body input[type="text"],
.modal-body input[type="number"],
.modal-body textarea,
.modal-body select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    color: var(--light, #f8fafc);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
}

.modal-body input:focus,
.modal-body textarea:focus,
.modal-body select:focus {
    border-color: var(--primary, #6366f1);
}

.form-message {
    margin-top: 12px;
    font-size: 0.9rem;
}

.form-message.success {
    color: #4caf50;
}

.form-message.error {
    color: #f44336;
}

.image-preview {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.image-preview-item {
    position: relative;
    width: 110px;
    cursor: grab;
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.image-preview-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.image-preview-item.dragging {
    opacity: 0.4;
    transform: scale(0.95);
    cursor: grabbing;
}

.image-preview-item.over {
    box-shadow: 0 0 0 2px var(--primary, #6366f1);
    border-radius: 10px;
}

.image-preview-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    display: block;
}

.image-preview-item.main-image img {
    border-color: var(--primary, #6366f1);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.image-preview-drag-handle {
    position: absolute;
    top: 4px;
    left: 4px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    cursor: grab;
    z-index: 2;
    background: rgba(0, 0, 0, 0.5);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    line-height: 1;
}

.image-preview-drag-handle:hover {
    color: white;
    background: rgba(0, 0, 0, 0.8);
}

.image-preview-label {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: var(--primary, #6366f1);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
}

.image-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(239, 68, 68, 0.85);
    color: white;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 0;
    transition: background 0.2s;
}

.image-preview-remove:hover {
    background: rgba(239, 68, 68, 1);
}

.page-title {
    color: var(--light, #f8fafc);
    font-size: 2rem;
    margin-bottom: 30px;
}

.admin-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    border-bottom: 2px solid rgba(99, 102, 241, 0.2);
}

.admin-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    color: var(--gray, #64748b);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.admin-tab.active {
    color: var(--primary, #6366f1);
    border-bottom-color: var(--primary, #6366f1);
}

.admin-actions {
    margin-bottom: 20px;
}

.admin-products-list,
.admin-coupons-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-product-card,
.admin-coupon-card {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-product-icon {
    font-size: 2rem;
}

.admin-product-info,
.admin-coupon-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--light, #f8fafc);
}

.admin-product-price {
    color: var(--primary, #6366f1);
    font-weight: 700;
}

.admin-product-category {
    color: var(--gray, #64748b);
    font-size: 0.85rem;
}

.admin-product-actions,
.admin-coupon-actions {
    display: flex;
    gap: 8px;
}

.admin-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.admin-badge.featured, .admin-badge.active {
    background: rgba(74, 222, 128, 0.2);
    color: #86efac;
}

.admin-badge.new {
    background: rgba(6, 182, 212, 0.2);
    color: #67e8f9;
}

.admin-badge.inactive {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

.form-check {
    margin: 12px 0;
}

.form-check label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--light, #f8fafc);
    cursor: pointer;
}

.nav-btn {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--light, #f8fafc);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.nav-btn:hover {
    background: rgba(99, 102, 241, 0.3);
}
